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

Issue in Click event

1 Answer 23 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ganesh
Top achievements
Rank 1
Ganesh asked on 25 Jul 2013, 10:31 AM
  • Hi Team,
      
    Im Using webaii framework for my automation.
    I have a page in there when we click a button it ll show one pop up. tried this scenerio in webaii with below code.
      
       Manage.ActiveBrowser.Actions.Click(button); 
      
    It clicks the button as expected, but when pop up was thrown by webpage, code flow got stopped it didnt cross the above command.
    Is it any other way to click a element after click, browser should be free and it ready for next command.

1 Answer, 1 is accepted

Sort by
0
Accepted
Velin Koychev
Telerik team
answered on 30 Jul 2013, 09:49 AM
Hi Ganesh,

Could you please elaborate more about your test scenario. Do you need to connect to the popup window and perform actions on it?

If that is the case, you can use code that is similar to this sample code against a public site with a popup child window:

  
//Turn on new browser tracking before the popup link is clicked
Manager.SetNewBrowserTracking(true);
  
Find.ByTagIndex<HtmlAnchor>("a", 58).Click();
Manager.WaitForNewBrowserConnect("http://www.htmlcodetutorial.com/linking/popup_test_a.html", true, 5000);
  
Log.WriteLine(Manager.Browsers.Count.ToString());
  
//You can now turn off new browser tracking
Manager.SetNewBrowserTracking(false);
  
//Check whether the ActiveBrowser is now the popup.
Assert.IsTrue(ActiveBrowser.Url.Contains("http://www.htmlcodetutorial.com/linking/popup_test_a.html"));

Here is a short video, which demonstrates it. 

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