Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to work on multiple windows using selenium, when I searched on the net, there are only explanations and codes available for Selenium2 webdriver version. For the normal selenium I can't find any info on it. So is there a way multiple window operations be performed in selenium + java , if yes, how can it be achieved?

Thank you,

share|improve this question

If, by "multiple windows", you mean "separate browsers", then the answer is yes, but differently from Ardesco's answer. In this case, you need to start multiple Selenium browser instances, and then use each one as a separate browser. We do exactly this to test the online-chat feature of our product, with each browser logged in as a different user and driving them to talk to each other.

share|improve this answer

Buh... forgive me for only responding in terms of theory and not in terms of practice, because I understand the concepts underlying what you're trying to do, but lack directly applicable experience with either set of the Selenium2 webdrivers.

With respect to what you're trying to achieve, however, it seems comparable to any asynchronous set of operations on multiple internet windows and therefore should be something you can handle thusly regardless of which programming language or tool set is employed.

Just glancing over the API documentation, it appears that the tools used for these types of events are the "andWait" / "waitFor" methods:

Since you didn't provide much detail as to WHAT you want to do with multiple windows, let's assume for a moment that your application wants to play tic-tac-toe in two windows, and one of each window is responsible for playing the side in question.

So. once you have successfully created a Selenium instance that can do ONE side of what you're looking to accomplish (check out for more webdriver docs -- I'm seeing everything you need there to get most jobs done), it simply becomes a matter of keeping both sides in sequence. You can run both jobs simultaneously and have them report back to a service daemon you create specifically for this purpose, tracking based on time stamps or other sequential data YOU provide arbitrarily to keep the events of each browser window "in step" with the other one.

Again, I can only respond in basic theory because of the limited amount of information I have on your project and my limited experience with Selenium; however, I hope this helps.

share|improve this answer

If I'm reading your question correctly you are asking if you can test multiple windows using the Selenium RC API. If so the answe is Yes.

Use selenium.selectWindow("Window[Titel/Id/Name]") to switch to different windows. This must be a window that has been opened by the browser controlled by Selenium.

You can get a list of available windows using one of the following:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.