Skip to main content
added 2 characters in body
Source Link
demouser123
  • 3.5k
  • 5
  • 29
  • 41

As @FDM mentioned the $x("//*[@id='email']") $x("//*[@id='email']") will find 2 matching elements. So you need to build a locator that is more unique/precise. If you search it in Firebug or any other console you'll notice that it yields two matching nodes.

I'm not sure in Python how it should be, but I tried this in Java using the following CSS selector and it worked.

driver.findElement(By.cssSelector("div[id=top-user-menu-wrapper] input[id=email]")).sendKeys("test");

As @FDM mentioned the $x("//*[@id='email']") will find 2 matching elements. So you need to build a locator that is more unique/precise. If you search it in Firebug or any other console you'll notice that it yields two matching nodes.

I'm not sure in Python how it should be, but I tried this in Java using the following CSS selector and it worked.

driver.findElement(By.cssSelector("div[id=top-user-menu-wrapper] input[id=email]")).sendKeys("test");

As @FDM mentioned the $x("//*[@id='email']") will find 2 matching elements. So you need to build a locator that is more unique/precise. If you search it in Firebug or any other console you'll notice that it yields two matching nodes.

I'm not sure in Python how it should be, but I tried this in Java using the following CSS selector and it worked.

driver.findElement(By.cssSelector("div[id=top-user-menu-wrapper] input[id=email]")).sendKeys("test");
Source Link
ilm
  • 386
  • 2
  • 5
  • 18

As @FDM mentioned the $x("//*[@id='email']") will find 2 matching elements. So you need to build a locator that is more unique/precise. If you search it in Firebug or any other console you'll notice that it yields two matching nodes.

I'm not sure in Python how it should be, but I tried this in Java using the following CSS selector and it worked.

driver.findElement(By.cssSelector("div[id=top-user-menu-wrapper] input[id=email]")).sendKeys("test");