Monday, May 13, 2013

Adding system property to point NonDefault FireFox in selenium

When we start selenium server for firefox, it would try to lauch firefox from default location. To enable us to lauch firefox from different location we need to set the system property firefoxDefaultPath with the LOCATION/firefox.exe
 To add this in ant script we need to do something like below
<property location="C:/Program Files (x86)/Mozilla Firefox-3.6.18/firefox.exe" name="browserExe"></property>
<exec executable="cmd.exe" os="${os.name}" spawn="true">
 <arg line="start">
 <arg value="java">
 <arg value="-jar">
 <arg value="${sel.server.path}${sel.server.jar}">
 <arg value="-DfirefoxDefaultPath=${browserExe}">
</exec>