Running Selenide with Selenium Grid?

Viewed 3866

In Selenide, creating a driver is simply using:

`open(Link);`

along with some system properties setting the webdriver and browser to use:

System.setProperty("webdriver.chrome.driver", "K:/chromedriver.exe");
System.setProperty("selenide.browser", "Chrome");

In Selenium however, you must declare drivers and set capabilities.

How would I configure my test cases in Selenide to run parallel on the Selenium Grid?

Does anyone have a sample set-up?

2 Answers

To run tests on Selenium Grid use selenide.remote system property. This way you don't need to manage WebDriver manually.

I use gradle and add this property for test task if it exists in an environmental variable:

test {
    useJUnitPlatform()
    def seleniumServerUrl = System.getenv("SELENIDE_REMOTE")
    if (seleniumServerUrl) {
        systemProperty("selenide.remote", seleniumServerUrl)
    }
}

or you can add a property in a command line: -Dselenide.remote=http://localhost:5678/wd/hub as suggested in https://selenide.org/faq.html

Related