Skip to content

Instantly share code, notes, and snippets.

@RickCollier
Created December 9, 2013 22:59
Show Gist options
  • Save RickCollier/7882645 to your computer and use it in GitHub Desktop.
Save RickCollier/7882645 to your computer and use it in GitHub Desktop.
Spring + Selenium webdriver. Couldn't find anything for this and it took me longer than it should have.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="desiredCapFF" class="org.openqa.selenium.remote.DesiredCapabilities">
<constructor-arg name="browser" value="firefox"/>
<constructor-arg name="version" value="" />
<constructor-arg><util:constant static-field="org.openqa.selenium.Platform.ANY"/></constructor-arg>
</bean>
<bean id="desiredCapIE" class="org.openqa.selenium.remote.DesiredCapabilities">
<constructor-arg name="browser" value="internet explorer" />
<constructor-arg name="version" value="" />
<constructor-arg><util:constant static-field="org.openqa.selenium.Platform.ANY"/></constructor-arg>
</bean>
<bean id="driverFF" class="org.openqa.selenium.remote.RemoteWebDriver">
<constructor-arg name="remoteAddress" ref="seleniumHub" />
<constructor-arg name="desiredCapabilities" ref="desiredCapFF" />
</bean>
<bean id="driverIE" class="org.openqa.selenium.remote.RemoteWebDriver">
<constructor-arg name="remoteAddress" ref="seleniumHub" />
<constructor-arg name="desiredCapabilities" ref="desiredCapIE" />
</bean>
<bean id="seleniumHub" class="java.net.URL">
<constructor-arg value="http://your-hub.your.domain:4444/wd/hub" />
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment