Problem with handle JS Pop-up.

11 posts, 0 answers
  1. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 09 Aug 2012 Link to this post

    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

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 13 Aug 2012 Link to this post

    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
  3. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 14 Aug 2012 Link to this post

    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.

  4. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 14 Aug 2012 Link to this post

    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.

  5. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 15 Aug 2012 Link to this post

    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
  6. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 02 Nov 2012 Link to this post

    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();

  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 07 Nov 2012 Link to this post

    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
  8. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 08 Nov 2012 Link to this post

    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?

  9. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 13 Nov 2012 Link to this post

    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
  10. Anton
    Anton avatar
    54 posts
    Member since:
    Sep 2011

    Posted 26 Nov 2012 Link to this post

    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.

  11. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 26 Nov 2012 Link to this post

    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
Back to Top