Fil,
Here's what I know [based on my limited explorations of the codebase]
InternetExplorer driver relies on the iedriver.dll/IEDriver.exe to find the iexplore binary and this seems to find the binary on its own and there seems to be no way in which you can specify an alternative location/batch file to launch IE. FirefoxDriver on the other hand does have this mechanism in place [as specified here : http://code.google.com/p/selenium/wiki/Grid2#Configuring_the_nodes]
I believe this was done intentionally because on a given machine only 1 installation of IE is expected to be available.
RemoteWebDriver would inturn rely on the native implementation that dwells within each of these concrete implementations of WebDrivers to spawn the respective browser and start the embedded server within it.
All that said and done, you can still get this to be done, if you use the features of the Grid.
The Grid provides you with a facility wherein you can inject your own Proxy [org.openqa.grid.selenium.proxy.DefaultRemoteProxy]
So here's what you would do.
Extend org.openqa.grid.selenium.proxy.DefaultRemoteProxy and create your own concrete version of a Proxy. You can take a look at this gist that I created : https://gist.github.com/3303591
Now within this custom proxy, you would basically need to override beforeSession() method [ This method should get called before a the node gets the request for a new session which essentially means that you are going to start a new test]
@Override
public void beforeSession(TestSession session) {
String requestedBrowser = (String) session.getRequestedCapabilities().get(CapabilityType.BROWSER_NAME);
if (requestedBrowser.equalsIgnoreCase("internet explorer")) {
try {
Runtime.getRuntime().exec("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
super.beforeSession(session);
}
Now to consume this you have two options :
Convert this project into a jar and then use :
java -cp "selenium-standalone-.2.25.0.jar;myproxy.jar" org.openqa.grid.selenium.GridLauncher -role node -hub http://localhost:4444/grid/register -port 5555 -proxy org.mycompany.MyProxy
Or you could convert your project into a gigantic jar [embedding all of the selenium libraries into it] and then merely use
That should get your requirement done.
P.S: I haven't had the time to test this implementation. I am telling you things based on my past explorations. So incase there are glitches, please do revert back and I will try to see what was missing. If it works, then also please do update this thread so that it can be helpful for others who are treading the same route as you.
Hope that helps !
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
On Wed, Aug 29, 2012 at 2:14 PM, filmac
<fma...@venere.com> wrote:
Hi all!
We're launching selenium tests using php against a selenium hub.
We are using phpunit 3.6 and selenium nodes are running version 2.25
We have some node configured to provide iexplore and since we use cookie a lot, we would like to clean cache between tests.
I tried to use deleteCookie and deleteAllVisibleCookies but with explorer they didn't work as expected.
I found that it's possible to run the following command:
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255
in order to clean the cache and I would like to create a bat file in order to run this command and launch explorer soon after.
But I have two doubts:
- how I change node configuration to launch explorer using my own bat file? I guess I need to define a *custom browser but I don't understand how to specify this in the json configuration of the node
- how do I bind a test to the particular custom node configuration?
Thanks
Fil
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/iHCLXtj73PYJ.
For more options, visit https://groups.google.com/groups/opt_out.