Running parallel tests in different browsers with Selenium Grid + Gradle

304 views
Skip to first unread message

mortega

unread,
Jan 4, 2017, 10:07:34 AM1/4/17
to Serenity BDD Users Group
Is there any way to run parallel tests in different browsers with Serenity? 

I am automating my tests with Serenity BDD + Selenium  Grid + Cucumber + Gradle.

At this moment, i can run my tests simultaneously in several instances of the same browser using Selenium Grid, but I am not able to run them in two different browsers (e.g. Internet Explorer and Chrome). I have tried, with no success, to define a RemoteWebDriver for each feature like this:

    public SearchFlightsSteps() throws MalformedURLException {
       
DesiredCapabilities capability = DesiredCapabilities.chrome();
        capability.setBrowserName("chrome");
        capability
.setPlatform(org.openqa.selenium.Platform.WINDOWS);
       
driver = new RemoteWebDriver(new URL("http://ip:4444/wd/hub"), capability);
        ryanairHomePage = new RyanairHomePage(driver);
   
}

   
@Step
    public void open() {
        driver.get(RyanairHomePage.URL);
   
}

This opens the browsers, but when i try to get an element from the page, I got 

net.serenitybdd.core.exceptions.SerenityManagedException: Expected enabled element was not enabled

That happens because the PageObject tries to use a Firefox browser instance instead of the one I give. 

I don't know if this I want is possible in Serenity BDD, but any help would be appreciated. 

mortega

unread,
Jan 5, 2017, 7:03:10 AM1/5/17
to Serenity BDD Users Group
The problem comes with the use of PageObject class with RemoteWebDriver. If I avoid this class, I can achieve it, but i want to use PageObject.
Reply all
Reply to author
Forward
0 new messages