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

Problem with handle JS Pop-up.

10 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 09 Aug 2012, 09:24 AM

Hello.

I have html code:

<input id="j_idt9:revertBtn" class="button-primary" type="submit" value="Revert" onclick="jsf.util.chain(this,event,"if(!confirm('Do you really want to revert these changes?'))return false;","RichFaces.ajax(\"j_idt9:revertBtn\",event,{\"incId\":\"1\"} )");return false;" name="j_idt9:revertBtn" disabled="">
 and code to handle pop-up:

Manager.DialogMonitor.AddDialog(AlertDialog.CreateAlertDialog(ActiveBrowser, DialogButton.OK));
Manager.DialogMonitor.Start();
Find.ById<HtmlInputSubmit>("j_idt9:revertBtn").Click();

In initialization phase i have:

Settings settings = GetSettings(); 

settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
Initialize(settings);

pop-up has Ok and Cancel buttons.

but when i execute test, pop-up appeared and then nothing happened.

Hm.. I noticed that pop-up "blinking" with this code.

PS. i try this link but have same issue.

PS2. I execute on IE9 and FF14.0.1 Win7 x64 but project compiled in x86

10 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 13 Aug 2012, 03:58 PM
Hello Anton,

First that's not an Alert dialog box. You are probably trying to handle a Confirm dialog box. There's a subtle difference... an Alert dialog only has one button, the OK button. The Confirm dialog box has OK and Cancel buttons.
 
Please try to handle the dialog as a Confirm dialog and let me know the result. Here's a sample code that works on this sample page:
// Create my confirm dialog
ConfirmDialog dlg = ConfirmDialog.CreateConfirmDialog(ActiveBrowser, DialogButton.OK);
Manager.DialogMonitor.AddDialog(dlg);
 
// Click 'TryItButtonTag'
Pages.TryitEditorV15.FrameView.TryItButtonTag.Click(false);
dlg.WaitUntilHandled(5000);


Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Anton
Top achievements
Rank 1
answered on 14 Aug 2012, 07:58 AM

I try it. and i try to automate alert and confirm from 

http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert

http://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm

but have the same issue.

0
Anton
Top achievements
Rank 1
answered on 14 Aug 2012, 02:31 PM

I solve the problem.

The reason of problem is Russian system language. I install English LIP and it solved the problem.

FYI: FileUploadDialog (and i think others too) also can't be handled in Russian language system.

0
Plamen
Telerik team
answered on 15 Aug 2012, 10:36 AM
Hi Anton,

I am glad to hear you found the solution. Appreciate the update!

All the best,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Anton
Top achievements
Rank 1
answered on 02 Nov 2012, 10:03 AM

Hello, 

Unfortunately my problem appeared again.

But now i have problem which reproduced only with FireFox 16.0.2.

On IE9 all is ok.

My code still not changed:

var dialog = ConfirmDialog.CreateConfirmDialog(ActiveBrowser, DialogButton.OK);
            Manager.DialogMonitor.AddDialog(dialog);
            //Manager.DialogMonitor.Start();
            Find.ByXPath<HtmlImage>("/html/body/form/div[2]/div[2]/span/div/div[5]/div/table/tbody/tr/td[5]/a/img").
                Click(false);
            dialog.WaitUntilHandled(15000);
              
            Manager.DialogMonitor.Stop();

0
Plamen
Telerik team
answered on 07 Nov 2012, 06:06 PM
Hi Anton,

Your code looks correct and it is not possible to determine what is causing the issue in Firefox without a local repro. Would it be possible to provide us with a copy of your test and access to your application. If it is not possible to grant us access to your application, please take a Fiddler trace and attach that in a zip file. You can capture a Fiddler trace using FiddlerCap.

If you feel any of this information is sensitive, you can submit a support ticket which is confidential, unlike this forum.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Anton
Top achievements
Rank 1
answered on 08 Nov 2012, 08:55 PM

Hello Plamen,

Yes, You can download it from here.

To make popup appeared, you should follow these steps:

1. Click on Repository button.

2. Click on 'Create Project' and create project.

3. Click in 'X' button in 'Action' column.

But i think this is not dependent on project.

Did you try to automate popup in Firefox 16.0.2 on W3C example?

0
Plamen
Telerik team
answered on 13 Nov 2012, 04:55 PM
Hello Anton,

Unfortunately as you can see in this video, I wasn't able to reproduce the issue against the "OpenL Tablets" app, neither against the W3C example. What am I doing differently? Can you please provide a sample executable test that demonstrates the issue or a video demonstrating the exact steps to follow in order to reproduce it? Jing is a free and decent screen recorder.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Anton
Top achievements
Rank 1
answered on 26 Nov 2012, 11:05 AM

Hello Plamen,

I try to execute tests on another computer with clean installation and it success.

I have no idea why WebAii stopped handle dialogs on my pc.

0
Plamen
Telerik team
answered on 26 Nov 2012, 02:53 PM
Hi Anton,

That's interesting. Are you using the same version of Telerik Testing Framework on both machines? Have you configured Firefox according our documentation seen here? Please provide more information regarding the problematic machine, including hardware and operating system configuration. We need to determine what is the difference between these two machines(browser versions, OS, TTF version).

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