Hi guys. I have the following doubt.
-- I need to check how many characters is a field accepting to enter. For example: FIELD A accepts up to 5 characters. It has an input validation. So, I send : getDriver().findElement(By.id("FIELD A")).sendKeys("1234567"); I need to check if the text entered was "12345" (instead of "1234567"). Any recomendation?? Thanks! You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/groups/opt_out. |
Hi Leandro,
I guess something like getDriver().findElement(By.id("FIELD A")).getValue() or .getText() or sth similiar but I guess you would have more chances for a response if you asked this question on Selenium users group :) Cheers! 2013/8/26 Leandro E <[hidden email]>: > Hi guys. I have the following doubt. > > I need to check how many characters is a field accepting to enter. > > For example: > FIELD A accepts up to 5 characters. It has an input validation. > > So, I send : > getDriver().findElement(By.id("FIELD A")).sendKeys("1234567"); > > I need to check if the text entered was "12345" (instead of "1234567"). > > Any recomendation?? > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "testng-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [hidden email]. > To post to this group, send email to [hidden email]. > Visit this group at http://groups.google.com/group/testng-users. > For more options, visit https://groups.google.com/groups/opt_out. -- Regards / Pozdrawiam Tomek Kaczanowski http://practicalunittesting.com -- You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/groups/opt_out. |
In reply to this post by Leandro E
The best way is to getDriver().findElement(By.id(
-- and then String textActual = getDriver().findElement(By.id( and then Assert.verifyEquals(textActual.length(), Expected); Thanks, Talon getDriver().findElement(By.id( On Monday, August 26, 2013 10:26:27 AM UTC-5, Leandro E wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/groups/opt_out. |
In reply to this post by Leandro E
Thanks Talon, it worked!
-- On Monday, August 26, 2013 12:26:27 PM UTC-3, Leandro E wrote:
You received this message because you are subscribed to the Google Groups "testng-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/testng-users. For more options, visit https://groups.google.com/groups/opt_out. |
Free forum by Nabble | Edit this page |