1

I have the following code in Selenium:

package automationFramework; 

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*; 
import org.openqa.selenium.By; 
import org.openqa.selenium.JavascriptExecutor; 
import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 
import org.openqa.selenium.remote.RemoteWebDriver; 
import org.openqa.selenium.support.ui.ExpectedConditions; 
import org.openqa.selenium.support.ui.WebDriverWait;

public class FirstTestCase {

    private static RemoteWebDriver jse;

    public static void main(String[] args) {        // TODO Auto-generated method stub //Create a new instance of firefox driver        

        System.setProperty("webdriver.gecko.driver","C:\\Users\\Javier\\Desktop\\selenium webdriver\\Gecko\\geckodriver.exe");      
        WebDriver driver = new FirefoxDriver();         //Launch one web        
        driver.get("xxxx");
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); 
        driver.findElement(By.className("mymwc-trigger")).click();      
        driver.findElement(By.className("mymwc-user")).sendKeys("x");


        driver.findElement(By.className("mymwc-pass")).sendKeys("xx");
        driver.findElement(By.className("login-submit")).click();       
        driver.findElement(By.className("continuebutton")).click();         
        WebDriverWait wait = new WebDriverWait(driver, 3);      
        driver.findElement(By.partialLinkText("working")).click();
    }

    private static void sleep(int i) {
        // TODO Auto-generated method stub

    }
}

When I put the last line driver.finElement..., I've the following error:

Error:

Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 57.0.4, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 74088, moz:profile: C:\Users\Javier\AppData\Loc..., moz:webdriverClick: false, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 6.1, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: b971b950-623d-47a8-8dc2-dba68146b9cc
    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.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
    at automationFramework.FirstTestCase.main(FirstTestCase.java:39)

Could you help me? Is there any limitation with geckodriver?

Gholamali Irani
  • 4,391
  • 6
  • 28
  • 59
FC_J
  • 53
  • 1
  • 6
  • it works adding the following . WebDriverWait wait1 = new WebDriverWait(driver, 30); WebElement element1 = wait1.until(ExpectedConditions.elementToBeClickable(By.xpath("/html/body/div[2]/div[2]/div/div/div/div/div[2]/ul/li[1]/a"))); element1.click(); – FC_J Jan 24 '18 at 14:23

0 Answers0