I have done a lot searching but cannot find a solution.
I am currently using the jebhave, spring project to setup my automated tests. This can be found here: http://ift.tt/1JbtRe2
The archetype is "org.jbehave:jbehave-spring-archetype" http://ift.tt/1xJ1phu
Currently the setup uses spring to inject the FirefoxWebDriverProvider but I need to somehow run these tests in Chrome and IE as well in parallel. I have found that using a PropertyWebDriverProvider allows me to run in different browsers if I set the system properties but I currently have to manually choose this by commenting out lines of code.
The spring xml has the following:
<bean id="driverProvider" class="org.jbehave.web.selenium.PropertyWebDriverProvider" >
</bean>
<bean id="webDriverProvider" class="org.jbehave.web.selenium.PerStoryWebDriverSteps">
<constructor-arg ref="driverProvider"/>
</bean>
<bean id="lifecycleSteps" class="com.three.automation.steps.LifecycleSteps">
<constructor-arg ref="driverProvider"/>
</bean>
Running this defaults to Firefox Driver unless I specify system properties (one at a time for each browser):
System.setProperty("browser", "chrome");
System.setProperty("webdriver.chrome.driver", "src/main/resources/chromedriver.exe");
//System.setProperty("browser", "ie");
//System.setProperty("webdriver.ie.driver", "src/main/resources/IEDriverServer.exe");
Is there a way setting this up so it automatically injects each driverprovider and runs tests on different threads?
Thanks is advance.
Aucun commentaire:
Enregistrer un commentaire