My Serenity BDD test cases are running fine on firefox when I used below annotations in step definition file:
@Managed
public WebDriver driver;
I wanted to run same test cases on chrome browser. So, modified it as below:
@Managed(driver = "chrome")
WebDriver driver;
Also tried below one:
@Managed(driver = "chrome")
ChromeDriver driver;
In both the above cases, my test cases are still running by opening Firefox instead of Chrome. I followed the exact steps as per mentioned in Serenity BDD guide. Can you please help me to know, how to execute Serenity BDD test scripts by opening Chrome. Thanks in advance for your help.
I haven't used Serenity yet but I had some experience with Thucydides (Senerity's predecessor). What I did in Thucydides to add Chrome support is by editing the thucydides.properties file (typically in src/test/resources) to add these lines:
webdriver.driver=chrome
webdriver.chrome.driver = C:\\chromedriver\\chromedriver.exe
It might work similarly in Serenity.