0

As we know in serenity bdd (cucumber) the webdriver is initiated by using PageObject class.

public class OpenPage extends PageObject {

    OpenPage(WebDriver driver){
           super(driver);
        }

        public void open_page() {
          getDriver().navigate().to("https://www.google.com/");
        }
}

In serenity.properties contains following property:

webdriver.chrome.driver = chromedriver  
webdriver.driver = chrome

Problem with the code is that this is not opening the chrome browser.

Bear
  • 662
  • 1
  • 5
  • 20

1 Answers1

0

If chrome is not opening, it is usually a compatibility issue between chrome or chromedriver. If chromedriver is on the system path, you don't need to explicitly declare the webdriver.chrome.driver property. Otherwise, it should be the relative path to the driver in your project (never a hard-coded absolute path).

Incidentally, your Page Object could be simplified to:

@DefaultUrl("https://www.google.com/")
public class OpenPage extends PageObject {}

(You hardly ever need to call getDriver() when using Serenity).

John Smart
  • 969
  • 1
  • 5
  • 5