Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
7.9k views
by
edited by

package Switch;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.Select;
public class WebElements {
    public static void main(String[] args) throws InterruptedException {
        System.setProperty("webdriver.chrome.driver", "C:\\selenium\\chromedriver_win32\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get("https://www.amazon.in/");
        Thread.sleep(4000);
        driver.findElement(By.id("twotabsearchtextbox")).sendKeys("POCO F1");
        Thread.sleep(4000);
        driver.findElement(By.className("nav-input")).click();
    }
}

I am getting below error:

org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

1 Answer

0 like 0 dislike
by Master (1.2k points)

The root cause was a ClassCastException. We now catch that exception, log the thing that we were trying to parse, and continue with other attempts to complete the handshake. The fix was available in Selenium Client v3.0.0-beta4.

Solution

  • Upgrade JDK to recent levels JDK 8u181.
  • Upgrade Selenium to current levels Version 3.14.0.
  • Upgrade GeckoDriver to GeckoDriver v0.20.1 level.
  • GeckoDriver is present in the specified location.
  • GeckoDriver is having executable permission for non-root users.
  • Upgrade Firefox version to Firefox v61.0.2 levels.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your Test as a non-root user.
by New User (10 points)
Thankyou Brother !! All it was required a system reboot :)
by Master (1.2k points)
Great you found your solution. Thank you for sharing.
...