Unable to locate element with ID: identifierId when automating gmail with selenium using jmeter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Unable to locate element with ID: identifierId when automating gmail with selenium using jmeter

Maneesha Wijesekara

Hi All,

I'm automating gmail login with selenium webdriver using jmeter but when executing the script, I'm getting the following error message with HTTP 500 status code,

Response message: Unable to locate element with ID: identifierId
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
System info: host: 'dhcppc4', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-127-generic', java.version: '1.8.0_161'
Driver info: driver.version: HtmlUnitDriver

Below is the snippet of the code,

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.support.ui.*;
import java.lang.String;
import java.util.concurrent.*;
import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.BrowserVersion;

try {
public HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.CHROME, true);
String protocole = "http://";
String tomcathost = vars.get("tomcatHost");
String seperator = ":";
String tomcatport = vars.get("tomcatPort");
String url = "/travelocity.com/index.jsp";

String appURL = protocole + tomcathost + seperator + tomcatport + url;

WebElement link = driver.findElement(By.linkText("here"));


String currentURL = driver.getCurrentUrl();

WebElement email_phone = driver.findElement(By.id("identifierId"));

.sendKeys("[hidden email]");


WebElement password = driver.findElement(By.xpath("//input[@name='password']"));
WebDriverWait wait = new WebDriverWait(driver, 20);
//Returns the whole page
return driver.getPageSource();  
} catch (Exception ex) {

I have a webapp that's hosted in a tomcat server and once after clicking the 'here' button it will redirect to gmail login (enter email) screen. I've verified the page when error occurs by printing the currentURL and web app directs to gmail login successfully.

According to the error, selenium automation failed to find the element 'identifierId' (email of the google login page) while do the automation. 

Any help to solve this would be highly appreciated.

Thanks and Regards

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9da37176-2994-47d1-ac18-9d76110ca69b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.