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

HTML popup handle

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mahdi
Top achievements
Rank 1
Mahdi asked on 26 Nov 2013, 08:14 AM
Good day,
While am recording a test case, one of the steps is to connect to HTML popup,, the issue is every time am running the test case the HTML popup will take different delay time to open,, I tried to use "Execution delay" step & "WaitUntilReady" but still can't handle the time,, and there is no estimated time that how long the HTML dialog need time to open.
I would like to ask if there is a way to wait the HTML dialog when open...??


Please advice,,

Thanks,
Mahdi

2 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 2
answered on 26 Nov 2013, 02:01 PM
I had this issue, but with saving and closing popups.  I solved it by using a coded step to check for the current managers browser count.  For instance, if you are on the websites main page, the browser count should be 1.  When a popup occurs, the count is then 2.  There may be a better way, but it has worked for me consistently.  Zip file is attached with 2 test html files.

1) Navigate to index.html
2) Click link
3) Coded step:
[CodedStep(@"Wait for popup and connect to it.")]
public void WaitForPopup()
{
    while (Manager.Browsers.Count == 1)
    {
        System.Threading.Thread.Sleep(2000);
        Log.WriteLine(Manager.Browsers.Count.ToString());
    }
    Manager.WaitForNewBrowserConnect("file://index2.html", true, 15000);
    Log.WriteLine(Manager.Browsers.Count.ToString());
}


Let me know if it does or does not work for you.  In my test it has regardless of the javascript delay I put in the popup.


0
Velin Koychev
Telerik team
answered on 28 Nov 2013, 03:29 PM
@ Daniel - Thank you for sharing your code. We really appreciate it.  I have also updated your Telerik points.
@Mahdi - Did you try this solution? 

Let me know if you need any additional assistance. 


Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Mahdi
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 2
Velin Koychev
Telerik team
Share this question
or