vendredi 10 mars 2017

FirefoxDriver() is not working - Selenium,Java

I have started learning automation with Selenium in java. I tried the same code in python and able to fetch contents from the website. But with java it throws "no suchmethod" error. I am using intellij and added selenium client and server 3.3.0. Firefox version 51.0.1. Kindly help.

    System.setProperty("webdriver.gecko.driver","/usr/local/bin/geckodriver");
    WebDriver driver=new FirefoxDriver();

    driver.get("http://ift.tt/2np2Uyy");
    System.out.println("flipkart reviews");
    List<WebElement> reviews=driver.findElements(By.xpath("//div[@class='_3DCdKt']"));
    for(WebElement review:reviews){
        System.out.println(review.getText());
    }

The error been thrown is the following.

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V




Aucun commentaire:

Enregistrer un commentaire