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

Manager.Browsers.Count

9 Answers 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kovyar
Top achievements
Rank 1
kovyar asked on 29 Jul 2010, 12:06 PM
Hi all.

Migrating our tests from WebAii 1.1 to WebAii 2.0, I suspect a strange behavior of Manager.Browsers.Count field.

The problem is that the count of actually opened browser windows is less than Manager.Browsers.Count.
How we get into this situation: our application opens its main window, then opens a modal window (HTML page, not an alert; Manager.Browsers.Count is now 2),
then a button on the modal window is pressed, so the window closes. But Manager.Browsers.Count does not become 1, as expected.

In our tests we usually check the count of the open windows to know whether the report window was successfully closed or not, so this option is vital for us. 

Thus I wonder if it could be fixed in some way.

Best regards,
Yaroslav

9 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 29 Jul 2010, 08:54 PM
Hello kovyar,

I apologize. This is a known regression we discovered a couple of weeks ago. I came up with a temporary work around you can use until we get the bug fixed in a release.

const int waitTimeout = 30000;  // timeout after 30 seconds
const int checkInterval = 200;  // test the condition every 200 milliseconds
int loopCount = waitTimeout / checkInterval;
// Save the handle upon entry. We're going to assume it's the popup that's about to close.
IntPtr hwnd = ActiveBrowser.Window.Handle;
while (ActiveBrowser.Window.Handle == hwnd && loopCount-- > 0)
{
    System.Threading.Thread.Sleep(200);
}
Assert.AreNotEqual<IntPtr>(ActiveBrowser.Window.Handle, hwnd, "The popup did not close");

Use this code in place of monitoring the browser count.

Best wishes,
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
0
kovyar
Top achievements
Rank 1
answered on 30 Jul 2010, 09:20 AM
HI Cody,

thanks for the code, I'll use it until the fix in release.
By the way, when are you going to release it?

Best regards,
Yaroslav
0
Cody
Telerik team
answered on 30 Jul 2010, 03:38 PM
Hello kovyar,

I am sorry I do not have an ETA at this time. It is in the queue to be worked on. Hopefully it won't take too long. I'll update this thread when a build with the fix is available.

Kind 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
0
kovyar
Top achievements
Rank 1
answered on 30 Jul 2010, 03:55 PM
Hi Cody.

That's sad we don't know how much to wait, but your words cause me to hope for the fix.
As I am subscribed to the thread, I'll know immediately about it.
Looking forward for the release.

All the best,
Yaroslav
0
kovyar
Top achievements
Rank 1
answered on 07 Sep 2010, 11:34 AM
Hi!

As far as we are planning fixing all the bugs which were discovered while running tests with WeAii 2.0, it would be great for us to know if you have scheduled this bugfix and the approximate date when you are going to have it fixed.

Sorry for being so annoying, but we need that to schedule our work.

All the best,
Yaroslav
0
Konstantin Petkov
Telerik team
answered on 10 Sep 2010, 11:15 AM
Hello kovyar,

There is no update in regards to this issue yet, I'm sorry. We will get back to you as soon as we have good news.

Best wishes,
Konstantin Petkov
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
0
Konstantin Petkov
Telerik team
answered on 21 May 2011, 07:15 PM
Hello kovyar,

Although my response got postpone quite a lot, let me update this thread sharing the issue has been recently resolved. If you get to update to the 2011.1 release you need a build 2011.1.520 or later including the fix.

I'm sorry for the delay and please do let us know if you have feedback regarding the new 2011 R1 version of the framework.

Regards,
Konstantin Petkov
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
0
Oleg
Top achievements
Rank 1
answered on 15 Nov 2011, 03:43 PM
Hello

I also have a problem with wrong Browsers count. I use Telerik.Testing.Framework.2011.2.1103
The code I use is below

     var beforeClickBrowsersCount = _browser.Manager.Browsers.Count;
var anchor = new HtmlDiv(element);
anchor.MouseClick(MouseClickType.LeftClick);
  var sw = new System.Diagnostics.Stopwatch();
sw.Start();
while (sw.ElapsedMilliseconds < timeout) {
if (_browser.Manager.Browsers.Count > beforeClickBrowsersCount) {
break;
}
System.Threading.Thread.Sleep(2000);
}
sw.Stop();

It clicks on the itemmenu at the page, and after that another new window of browser is created. But browsers count is not changing.  The ActiveBrowser.Window.Handle is also not changing. But if I click the itemmenu by myself during the test, the browsers count is changing like there is some difference between my click and Telerik MouseClick.
0
Stoich
Telerik team
answered on 21 Nov 2011, 03:27 PM
Hello Oleg,
you're probably experiencing a timing issue.

What's the timeout set to? I tried to reproduce this issue but I was unable to do so. The Testing Framework clicked worked the same way as a Desktop click. The only thing I was able to establish was that you need to wait a bit after a click in order for the browser count to change. Try adding a fixed delay after the click:
System.Threading.Thread.Sleep(3000);

All the best,
Stoich
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
kovyar
Top achievements
Rank 1
Answers by
Cody
Telerik team
kovyar
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Oleg
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or