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

Launching and navigating elements of multiple browsers at the same time

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
autotester
Top achievements
Rank 1
autotester asked on 28 Apr 2010, 08:56 PM

In one of the threads before I read that we can't have two manager objects as I noticed when getting all pipe busy message. What is the suggested way in creating X number of browser sessions and navigating them indipendently?

This didn't work for me:

 

 

Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true);
Manager.LaunchNewBrowser(BrowserType.InternetExplorer, true); 

 

 

...
...
int numberOfBrowsers = Manager.Browsers.Count; //shows correct number of browser sessions
Manager.Browsers[0].Window.Show();
Manager.Browsers[0].Window.SetActive();

//how to find an element in silverlight page that is on the list
Pages.PageName.MyButton.Click(false);
Manager.ActiveBrowser.Window.Minimize();

Manager.Browsers[1].Window.Show();
Manager.Browsers[1].Window.SetActive();
Pages.PageName.MyButton.Click(false); //problem with this - it can't find this element to click on

...
...

Any Ideas? Thanks.

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 29 Apr 2010, 05:45 PM
Hello autotester,

I see the problem you are running in to. First the Pages class always acts on the Manager.ActiveBrowser object and unfortunately this cannot be set by your program. The framework will set it as it sees browsers open and close. it's designed to point to the most recently opened browser. The fundamental design principle is that the test would only interact with one browser at a time.

Another point of confusion is that the Window.SetActive() function only sets that browser window as the active window from Windows point of view. It doesn't actually change Manager.ActiveBrowser to point to that browser window (though perhaps it should).

You can still do what you're trying to do but use Browser[0] directly instead of relying on Manager.ActiveBrowser. This means you can't use the Pages class as is. You could take it and modify it to meet your needs. Here's an example of how to use the Browsers array:

Manager.Browsers[1].Find.ById<HtmlButton>("btnNext").Click();


Regards,
Cody
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
autotester
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or