I am testing a website using Selenium Webdriver.
Eclipse has to fetch username from excel.
When the Username data in excel is xyz
my test enters the username value twice, xyzxyz
, into the form.
How can I fix it so that the data is entered only once.
Code is:
driver.findElement(By.id("username")).sendKeys("xyz");
Add the following statement before the
SendKeys
line, so that the field is cleared before the filename is entered.(Answer derived from a comment by @Subh.)