This is a migrated thread and some comments may be shown as answers.

Opening Two Browsers

7 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 17 May 2011, 12:52 PM
I have a test requiring two browsers be open at the same time? How is that accomplished using Web UI. I tried recording the step of launching IE twice, but that didn't execute two browser launches.

7 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 17 May 2011, 01:05 PM
Hi Tom,
    you can do it in code with the Manager.LaunchNewBrowser() step (screenshot 1). There are 7 LaunchNewBrowser() (taking different parameters) so check them out. However, you can only have one ActiveBrowser at a time. You can only perform actions in the ActiveBrowser. Any other browser you launch will just stand there.

Greetings,
Stoich
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Tom
Top achievements
Rank 1
answered on 18 May 2011, 08:48 PM
So, is there another way to test for data collisions on the same PC?
0
Konstantin Petkov
Telerik team
answered on 23 May 2011, 08:00 AM
Hello Tom,

I think it will be best if you can explain your exact scenario and the goal you want to achieve. This way we can think of the best solution for this specific case.

What does the application under test performs that you want to automate? What are you afraid by meaning data collisions? Thanks for clarifying!

Regards,
Konstantin Petkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Tom
Top achievements
Rank 1
answered on 23 May 2011, 02:44 PM
Hi Konstantin,

We have an application that should not require saving a configuration to see the changes to the configuration. What my test entails is:

1. Open two browsers.
2. Change the configuration of a Sliverlight application in Browser 1.
3. Change the configuration of the same Silverlight application in Browser 2.
4. Compare the two browsers to make sure one configuration did not conflict with the other.

Thanks,
TomB
0
Cody
Telerik team
answered on 23 May 2011, 09:02 PM
Hi Tom,

This requires hand coding. Please review this documentation on how to handle multiple browser instances.

Kind regards,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Tom
Top achievements
Rank 1
answered on 24 May 2011, 01:16 PM
So after using the coded step to get a second instance of IE, I would then enter more code to change configuration settings in my Silverlight application, or can the second browser then be interfaced with through mouse clicks and keystrokes like the first browser?

Is the entire test as it's laid out in the documentation scenario done in code, or would that code be a coded step that's added to a script, or does it not matter?

Thanks,
TomB
0
Cody
Telerik team
answered on 24 May 2011, 10:25 PM
Hi Tom,

When you want to handle multiple browsers you cannot use what we refer to as the "Active Browser". "Active Browser" is defined as the most recently opened browser window. All of your standard test steps will automatically be directed at the "Active Browser". Thus if you use code to launch a second browser window (and code is the only way to do this) then any non-coded test steps will use that new browser window.

To be able to perform actions on the first browser window (the one that the framework automatically opens during test initialization) requires a coded step that contains code like the documentation I pointed you to. Here is some sample code how you could do it:

Browser FirstBrowser;
 
[CodedStep("Launch new browser")]
public void LaunchBrowser()
{
    FirstBrowser = ActiveBrowser;
    Manager.LaunchNewBrowser();
}
 
[CodedStep("Click in first browser")]
public void ClickBrowser0()
{
    FirstBrowser.Find.ById<HtmlButton>("next").Click();
}

Greetings,
Cody
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Tom
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Tom
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Cody
Telerik team
Share this question
or