Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.33/5 (3 votes)
See more:
Hi all,
I am trying to create selenium java script for Gmail Login page. but while finding password text box by using id or class attributes i am getting 'Element not found exception', Can anyone suggest me any diff ways to write it. sample code below,
WebDriver we=new FirefoxDriver();
we.get("http://www.gmail.com");
we.findElement(By.id("Email")).sendKeys("xxxxx@gmail.com");
we.findElement(By.id("next")).click();
we.findElement(By.id("Passwd")).sendKeys("xxxxxxxx");// Getting exception for this line
we.findElement(By.id("signIn")).click();
Posted
Updated 2-Nov-15 4:08am
Comments
Afzaal Ahmad Zeeshan 2-Nov-15 10:12am    
The error is clear. The element is not found, the element may not have that ID or like the ID may be something else (a typo?).
sselva28 2-Nov-15 10:17am    
Here you can see the HTML code
<input type="password" class="" placeholder="Password" name="Passwd" id="Passwd">
sselva28 2-Nov-15 10:15am    
Here you can see the HTML code
<input type="password" class="" placeholder="Password" name="Passwd" id="Passwd">
Sergey Alexandrovich Kryukov 2-Nov-15 10:25am    
There is no such thing as "Java script". Java is not a scripting language. ;-)
—SA
sselva28 2-Nov-15 10:51am    
I am using JAVA in selenium and not asked you to correct my comment. if you dont know means pls dont add unwanted comments.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900