gmail using selenium driver in eclipse

+4 votes
package CoreJava;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

public class Tutorials1 {

public static void main(String[] args) {

// System.setProperty("",

// "C:\\Users\\everybody\\Desktop\\selenium\\library\\chromedriver.exe");

WebDriver driver = new FirefoxDriver();








The above code gave me the following error. i am trying to use the className on the new version of gmail

Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"identifier"}

Command duration or timeout: 684 milliseconds

For documentation on this error, please visit:

Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'

System info: host: 'LAPTOP-0BTLVCK6', ip: '', 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'

Driver info: org.openqa.selenium.firefox.FirefoxDriver

Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=36.0, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]

Session ID: f500dd0c-fcc1-427d-873c-a189c183a730

*** Element info: {Using=id, value=identifier}

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(

at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(

at org.openqa.selenium.remote.RemoteWebDriver.execute(

at org.openqa.selenium.remote.RemoteWebDriver.findElement(

at org.openqa.selenium.remote.RemoteWebDriver.findElementById(

at org.openqa.selenium.By$ById.findElement(

at org.openqa.selenium.remote.RemoteWebDriver.findElement(

at CoreJava.Tutorials1.main(

Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"identifier"}

For documentation on this error, please visit:

Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'

System info: host: 'LAPTOP-0BTLVCK6', ip: '', 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_181'

Driver info: driver.version: unknown

at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/

at <anonymous class>.FirefoxDriver.prototype.findElement(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/

at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/

at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/

at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/
Sep 11, 2018 in Selenium by fan
• 190 points
There is a mismatch in your need to call geckodriver.exe
More details in my answer below.

2 answers to this question.

+4 votes
Best answer

@letslearn, it seems like you have tried using chromedriver.exe for performing the test. Below line is what you have in your code.

// System.setProperty("",

// "C:\\Users\\everybody\\Desktop\\selenium\\library\\chromedriver.exe");

For some strange reason, you have commented out these two lines above. system.setProperty() function is highly essential line if you want to run your test and it is used to chose a particular browser on which the test will be performed...

Moreover, in your entire code, you have wanted to perform the test on Firefox (Gecko), but you've set property for chromedriver.exe as it is evident from above. 


Download geckodriver.exe from and provide the path to gecko driver in the above line of code..

Let me know if it works for you :) Happy learning :) 

answered Sep 11, 2018 by Vardhan
• 12,590 points

selected Sep 11, 2018 by Omkar
0 votes

Try using this:

WebElement id = driver.findElement("identifierId"));
WebElement button = driver.findElement(By.className("CwaK9"));;
WebElement password = driver.findElement("password"));
WebElement button1 = driver.findElement(By.className("CwaK9"));;

This worked fine for me. Hope it helps you too!

answered Dec 20, 2018 by Priyaj
• 56,900 points

Related Questions In Selenium

0 votes
1 answer

unable to launch my first code in eclipse using selenium chrome driver

@klbret, can you share your code or ...READ MORE

answered 4 days ago in Selenium by Abha
• 23,960 points
0 votes
1 answer

Login page test script using selenium and java in Eclipse IDE

Here is an example to login to ...READ MORE

answered Apr 23, 2018 in Selenium by Meci Matt
• 9,420 points
+9 votes
14 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,250 points
0 votes
2 answers

Get text using selenium web driver in python

text = driver.find_element_by_class_name("current-text").getText(); READ MORE

answered Feb 4 in Selenium by anonymous
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
+6 votes
1 answer

Recording all of our test cases in Selenium IDE

Well @vincitydaimo, for obvious reasons we prefer not ...READ MORE

answered Sep 20, 2018 in Selenium by Vardhan
• 12,590 points
+1 vote
2 answers

How to get the title of a webpage using Selenium Java?

Essentially, driver.getTitle(); function can be used to ...READ MORE

answered Dec 17, 2018 in Selenium by Vardhan
• 12,590 points