I am facing a challenge in my project. There are two text box’s in a page and where First text box will accept an email ID and when user move his control to next text box email ID from First text box will populate automatically in the second text box. I need to validate this test case.
I tried with following code,
WebElement emailElement = driver.findElement(By.id("email"));
emailElement.sendKeys("ABCDEFG@g.com");
WebElement usernameElement = driver.findElement(By.id("username"));
String userName = usernameElement.getAttribute("value");
assertEquals("ABCDEFG@g.com", userName);
Can someone help me with webdriver java code to fetch value from second text box(username).
Thanks in advance,
^Best regards
What about this ?
If you want to send the
TABkey with selenium, you can do that :All special keys are available here