Reputation: 27
so I have set up my step definitions and cucumber scenarios and they r running fine using firefox (since my step def are using firefox webdriver) but now I need to run my scenarios crossbrowser. I have been looking at selenium grid as an option but would greatly appreciate if someone can guide me on how to run my cucumber scenarios crossbrowser. thanks
Upvotes: 0
Views: 125
Reputation: 47
When running WebDriver using any browser that is not Firefox you will need to use a third-party WebDriver.
Use the links Aravin has provided to download the WebDrivers.
You will also need to set a system property to where the third party driver files are located.
Here's an example of setting up a new ChromeDriver instance in Java:
System.setProperty("webdriver.chrome.driver", "path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();
IE:
System.setProperty("webdriver.ie.driver", "path/to/iedriver.exe");
WebDriver = new InternetExplorerDriver();
This should set you up a local instance for the above browsers.
If you are thinking of using grid, you can find plenty of info in the docs
Upvotes: 1
Reputation: 7067
You have to use the corresponding driver for the browser to execute your scenario.
For Chrome: https://code.google.com/p/selenium/wiki/ChromeDriver
For IE: https://code.google.com/p/selenium/wiki/InternetExplorerDriver
For Safari: https://code.google.com/p/selenium/wiki/SafariDriver
You can configure this in env.rb
file of your project.
Upvotes: 0