Make Selenium use an already opened Chrome instance (don’t waste time when debugging scripts)

For Selenium script debugging purposes

public class SelenideConf {
@BeforeSuite(alwaysRun = true)
public void setUp() {
System.setProperty(“webdriver.chrome.driver”, “C:\\selenium\\chromedriver.exe”);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption(“debuggerAddress”, “127.0.0.1:9222”);
WebDriverRunner.setWebDriver(new ChromeDriver(options));
}
}

and start a Chrome instance manually by executing:

chrome.exe –remote-debugging-port=9222 –user-data-dir=”C:\selenium\AutomationProfile”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s