How do I pass control of a browser from one selenium java client to another?

271 views Asked by At

I have some scripts (in fitnesse) that executes some selenium commands. However, there are some processes wherein it would be too complex (or hackish) with a plain selenium (+fitnesse) approach, so I'm planning to create my own class which will handle those complex processing (i.e. check if the items in the table are sorted in ascending date).

This class would then have to take control of the browser that the first selenium java client has launched (i.e. after logging in, navigating to some pages, doing some other actions), and then do its specialized actions.

How would I be able to do that with the selenium java client?

1

There are 1 answers

0
nirvdrum On

Generally speaking you can do this if you have the Selenium session ID. The session ID is how the Selenium server associates a command with a particular browser.

As for how you go about passing that around or using it in the Java client, I'd dig into the javadocs. But I do this in Ruby and it works quite well.