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

Chrome and AlertDialog()

19 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 03 Feb 2014, 09:58 PM
The following code works great on IE and FF:
AlertDialog SearchResults200Dialog = new AlertDialog(AiiBrowser, DialogButton.OK);
 
Manager.Current.DialogMonitor.AddDialog(SearchResults200Dialog);
 
Manager.Current.DialogMonitor.Start();
 
consentSearch.SearchClick();

SearchClick() causes the web page to invoke a Window.Alert().

The DialogMonitor never 'sees' the alert dialog if the browser is Chrome.  Is this thanks to our new best friend Chrome v32?

19 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 04 Feb 2014, 02:15 PM
Oh, and yes - I did try this with the 1327 Framework...
0
Ivaylo
Telerik team
answered on 07 Feb 2014, 07:45 AM
Hello Steve,

I am sorry you are experiencing this issue. I have tried handling the alert dialog with Chrome v32 but I was not able to reproduce the behavior described. Here is a sample video demonstrating how this is working on my end. Could you please try adding the following line to your code and see how this will work for you:

SearchResults200Dialog.WaitUntilHandled(1500);

If this is not working for you could you please provide me with a reliable repro using this URL so I can continue investigating?

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Steve
Top achievements
Rank 1
answered on 07 Feb 2014, 04:22 PM
No love.  So, I made a video of me trying it against that URL you sent - have a look: 

Chrome32 Fail

Sorry it's so big - I have multiple monitors, and Jing doesn't handle that very well, it seems, but I'm not an expert at using Jing, wither...
0
Steve
Top achievements
Rank 1
answered on 07 Feb 2014, 04:34 PM
Also, if I change from .Click(true) to .Click(false) - I get a different exception - maybe this helps:

ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'d4cd180c-d0b0-4b8b-a4d9-ca9d25205be3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'0',InError:'False',Response:'')
InnerException: System.TimeoutException: Timed out waiting for command to be handled
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId, Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserHttpRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
0
Steve
Top achievements
Rank 1
answered on 07 Feb 2014, 04:52 PM
Also - in that code I just put in that movie - I realize I did not have DialogMonitor.Start() in it, I added that, and am still having the same problem...
0
Ivaylo
Telerik team
answered on 12 Feb 2014, 02:06 PM
Hello Steve,

Please provide me the test you are willing to run against the public URL so I can take a better look and fix this for you.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Steve
Top achievements
Rank 1
answered on 12 Feb 2014, 02:20 PM
Change the BrowserType to IE and FF to see that it works.  This is not to say that our corporate proxy isn't kiling us on this, or somehow we've managed to get Chrome v32 in a bad state, but this code fails every time for me.  Set a breakpoint on the last line, handleCount should = 1.

[TestMethod]
public void sand()
{
Manager Manager = new ArtOfTest.WebAii.Core.Manager(false);

Manager.Start();

Manager.LaunchNewBrowser(BrowserType.Chrome);

Browser Browser = Manager.ActiveBrowser;

Browser.NavigateTo("http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert");

System.Threading.Thread.Sleep(4000);

Browser.RefreshDomTree();

AlertDialog alert = new AlertDialog(Browser, DialogButton.OK);

Manager.DialogMonitor.AddDialog(alert);

Manager.DialogMonitor.Start();

Browser.Frames.ById("iframeResult").Find.ByContent<HtmlButton>("Try It").Click(true);

alert.WaitUntilHandled(1500);

int handleCount = alert.HandleCount;

Manager.Dispose();

}
0
Ivaylo
Telerik team
answered on 17 Feb 2014, 01:05 PM
Hello Steve,

Please excuse me for the delayed reply. I have been able to reproduce the behavior you are experiencing and I logged a bug on your behalf which you can see and keep track using this public URL.

Unfortunately no workaround can be provided at this point.

I have updated your telerik points accordingly for reporting this issue.

Thank you for your understanding and cooperation.

Regards,
Ivaylo
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Steve
Top achievements
Rank 1
answered on 24 Mar 2014, 01:02 PM
Looks like we've lost traction on this issue - I added my comments on the defect earlier this month - can you see where we are?  I'm doing no testing on Chrome at this point...
0
Ivaylo
Telerik team
answered on 27 Mar 2014, 11:26 AM
Hello Steve,

We are still trying to reproduce this behavior on a build machine, since we are able to reproduce this specifically on one machine which is not a build machine, which interferes with further investigation. We are trying to find the specifics of causing this. Since this is happening on only one machine on our side, all others are working fine we are positive this is an environment specific problem (the hardest to solve) could you please try to reproduce this behavior on a different machine in your network, are you getting the same behavior?

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Steve
Top achievements
Rank 1
answered on 27 Mar 2014, 02:26 PM
It fails on every machine I try it on,  I just created a project in VS 2010 on a Windows Server 2008 VM with the 1417 framework and Chrome 33.0.1750.154 m and it fails.  Please try it just inside visual studio - install a clean copy of VS 2012, install whatever testing framework you want to use, include a reference to the WebAii dll and run the code I posted - it fails on every machine we have here.
0
Ivaylo
Telerik team
answered on 01 Apr 2014, 08:35 AM
Hello Steve,

Using the code you have provided we are not able to reproduce this behavior any longer. Another way we can proceed here is if you create a sample project containing only one test that recreates the problem (simplified as much as possible) and attach it here. Using a complete project instead of using the provided code may behave differently.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Steve
Top achievements
Rank 1
answered on 01 Apr 2014, 12:57 PM
Here you go - I whipped this up in VS 2010.  You will have to update the reference to the WebAii dll.
0
Ivaylo
Telerik team
answered on 03 Apr 2014, 08:08 AM
Hello Steve,

Thank you for providing me with the project, I am forcing our development and putting a high priority on this issue in order to be resolved as soon as possible. As soon as I have any update I will update this ticket.

Thank you for your understanding.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Ivaylo
Telerik team
answered on 07 Apr 2014, 12:51 PM
Hello Steve,

Thank you for your patience regarding this matter. 
We had the chance to locate the problem causing your test to fail and it turned out it has pretty easy workaround. Just make sure you have the Dialog monitoring enabled by using this line:

Manager.Settings.DisableDialogMonitoring = true;

Here is a short video how this is working on my end.
The complete code should look like this and it should work perfectly fine on your end as well:

[TestMethod]
       public void TestMethod1()
       {
 
           Manager Manager = new ArtOfTest.WebAii.Core.Manager(false);
           Manager.Settings.DisableDialogMonitoring = true;
           Manager.Start();           
 
           Manager.LaunchNewBrowser(BrowserType.Chrome);
 
           Browser Browser = Manager.ActiveBrowser;
 
           Browser.NavigateTo("http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_alert");
 
           System.Threading.Thread.Sleep(4000);
 
           Browser.RefreshDomTree();
 
           AlertDialog alert = new AlertDialog(Browser, DialogButton.OK);
 
           Manager.DialogMonitor.AddDialog(alert);
           Manager.DialogMonitor.Start();
 
           Browser.Frames.ById("iframeResult").Find.ByContent<HtmlButton>("Try It").Click(true);
 
           alert.WaitUntilHandled(5000);
 
           int handleCount = alert.HandleCount;
 
           Manager.Dispose();


We will be including the fix for this in the internal build that we are going to release later this week, so adding the additional line will not be necessary.

Thank you for your understanding and patience regarding this matter.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Steve
Top achievements
Rank 1
answered on 17 Jul 2014, 01:20 PM
Have you guys come up with a permanent fix for this issue yet?  In Chrome 35, this problem has reappeared in our app, and the workaround no longer works, although the workaround still works with the above code on the tryit page.  Works fine in our code on FF and IE still.  I'm using 2014.1.410.0 of the framework.
0
Ivaylo
Telerik team
answered on 22 Jul 2014, 07:50 AM
Hello Steve,

You can give it a try with the latest internal build we released, which contains some fixes for the latest Chrome version.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Steve
Top achievements
Rank 1
answered on 23 Jul 2014, 03:39 PM
Works great - thanks.  Is there a way to be notified via email when Telerik relases an official framework?
0
Ivaylo
Telerik team
answered on 24 Jul 2014, 08:00 AM
Hello Steve,

I am glad to hear it is working fine on your end.

Unfortunately there is no way to get notified when an official framework is released, but you can subscribe to the RSS feed of our blog and get updates.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or