Open the Browser using selenium without binary files
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class OpenBrowserwithoutexe {
public static void main(String[] args) {
WebDriverManager.chromedriver().version("90.0.4430").setup();
WebDriver
driver = new ChromeDriver();
}
}
If you get below error you
need to update the chrome browser and it should be latest version you are using.
org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports
Chrome version 91
Current browser version is
90.0.4430.93 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
If you still get the same error,
then better specify the version in while opening the browser using version
method as below.
WebDriverManager.chromedriver().version("90.0.4430").setup();
Note version of the browser
must be matching with one of the versions defined in C:\Program
Files\Google\Chrome\Application\chrome.exe as
below
Note:- if you don't want to specify the version you can directly use below code.
WebDriverManager.chromedriver().setup();
but in this case WebDriverManager with take the latest version from the C:\Program Files\Google\Chrome\Application\chrome.exe path
Post a Comment