Trying my hands on selenium these days. When I inspect the element with firebug this is displayed as selected: None
I am not able to locate this element that has span element as None How do I locate/find this element.
Trying my hands on selenium these days. When I inspect the element with firebug this is displayed as selected: None
I am not able to locate this element that has span element as None How do I locate/find this element.
You can locate this element via Xpath or Css selector without using its attribute, which it does not have any.
For example:
//a[@class='chosen-single']/span
a[class='chosen-single'] span
You can use below snippet:
driver.findElement(By.xpath("//*[@id='id_center_chosen']/span")).click();
OR
driver.findElement(By.xpath("//*[@id=\"id_center_chosen\"]/descendant::span[text()='None']")).click();
Best option would be try locating the element using s Selenium IDE with Firefox. Then Navigate to Options->Format and select the language that your are working on. Then Again from the IDE click on the "Source" tab and look how Selenium IDE perform the element identification part.
this could be your help
how to find int value within span class Selenium C#
try to bring exact error if possible