I am trying to Login to Ebay site using Selenium. I have successfully identified the user name and password Text boxes using Xpath (and validated the xpaths using the Firefox Eval tool in Firebug).

public class LoginTestCase{     
    public void LoginEbay() throws InterruptedException 
        System.setProperty("webdriver.gecko.driver", "D:\\selenium_library\\geckodriver-v0.17.0-win64\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();

        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

        //navigate to Ebay

        // Enter user name , password and click on Signin button
        driver.findElement(By.xpath("//input[@placeholder='Email or username' AND @type='text']")).sendKeys("####@###");            
        //driver.findElement(By.xpath("//input[@placeholder='Password' AND @class='fld']']")).sendKeys("####");

I am getting the below warning after which the script Fails.

1499976357508   geckodriver INFO    Listening on
1499976358783   geckodriver::marionette INFO    Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe with args ["-marionette"]
1499976367184   Marionette  INFO    Listening on port 62686
Jul 13, 2017 4:06:20 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
JavaScript warning: https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&ru=https%3A%2F%2Fwww.ebay.com%2F, line 170: unreachable code after return statement

1 Answer 1


The warnings you see on the console are there because of the DEBUG logging turned on by default, they have nothing to do with the real problem as it turns out.

Your XPath expression is not valid, AND should be lower-cased:

//input[@placeholder='Email or username' and @type='text']

As a side note:

  • you should not be using hardcoded time delays to tackle timing issues - use WebDriverWait and specify what are you waiting for explicitly
  • you can use better locators

Improved ebay logging in code snippet:

//navigate to Ebay

WebDriverWait wait = new WebDriverWait(driver, 20);

// Enter user name , password and click on Signin button
WebElement form = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#mainCnt #SignInForm")));

form.findElement(By.cssSelector("input[type=text][placeholder='Email or username']")).sendKeys("####@###");


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.