Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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
add comment

3 Answers

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
add comment

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: http://seleniumhq.org/docs/02_selenium_ide.html#the-andwait-commands

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 http://seleniumhq.org/docs/03_webdriver.html 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
add comment

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:

selenium.getAllWindowTitles();
selenium.getAllWindowIds();
selenium.getAllWindowNames();
share|improve this answer
add comment

Your Answer

 
discard

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.