Reputation: 59
I am trying to run a script but there is an element not found error. Xpath not get detected by Selenium. I am trying to generate email address randomly.
Each time there is an error that [error] Element .//[@id='GmailAddress'] not found. Where ".//[@id='GmailAddress'" is Xpath of the desired text field. JavaScript is here for that specified fraction:
Selenium.prototype.doGenerateRandomEmail= function(locator)
{
Selenium.doType(locator,"[email protected]");
}
I just need that "[email protected]" address appear in text field when I run Selenium IDE.
Kindly tell where is the problem either in JavaScript or in Selenium command.
Upvotes: 0
Views: 317
Reputation: 4621
Try changing
//[@id='GmailAddress']
to: //*[@id='GmailAddress']
. You are missing an *
in your code.
Upvotes: 3