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("webdriver.chrome.driver",
// "C:\\Users\\everybody\\Desktop\\selenium\\library\\chromedriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("
https://www.gmail.com");
driver.findElement(By.id("identifier")).sendKeys("solomonfan1990");
driver.findElement(By.className("Next")).click();
driver.findElement(By.className("password")).sendKeys("ertyuir");
driver.findElement(By.className("Next")).click();
}
}
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:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'LAPTOP-0BTLVCK6', ip: '192.168.17.1', os.name: '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(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:393)
at org.openqa.selenium.By$ById.findElement(By.java:214)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
at CoreJava.Tutorials1.main(Tutorials1.java:16)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"identifier"}
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'LAPTOP-0BTLVCK6', ip: '192.168.17.1', os.name: '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/fxdriver@googlecode.com/components/driver-component.js:10271)
at <anonymous class>.FirefoxDriver.prototype.findElement(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10280)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12274)
at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12279)
at <anonymous class>.DelayedCommand.prototype.execute/<(file:///C:/Users/EVERYB~1/AppData/Local/Temp/anonymous1783806094359282166webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12221)