We have to create a test with the following steps:
- Open a Form View page (contains two buttons ‘ctlView’ and ‘ctlEdit’)
- Click ‘View’ button
- an HTML pop-up window will be displayed
- close pop-up above
- Continue find and click on the other ‘Edit’ button on the Form View page.
This is my code:
ActiveBrowser.NavigateTo(“~/FormView.aspx”)
Dim btnView As HtmlInputButton = ActiveBrowser.Find.ById("ctlView")
Manager.SetNewBrowserTracking(True)
btnView.Click(False)
Manager.WaitForNewBrowserConnect("ViewStatus.aspx”, True, 3000)
ActiveBrowser.WaitUntilReady()
Manager.SetNewBrowserTracking(False)
Assert.IsTrue(ActiveBrowser.Url.Contains("ViewStatus.aspx"))
ActiveBrowser.Close()
Dim btnEdit As HtmlInputButton = ActiveBrowser.Find.ById("ctlEdit")
btnEdit.Click(False)
My issue is that after executing the close pop-up statement ActiveBrowser.Close(), two browsers (main page and HTML pop-up) are closed, and the test fail at step of finding the ‘Edit’ button (Dim btnEdit As HtmlInputButton = ActiveBrowser.Find.ById("ctlEdit")).
Anyone please help me to fix this problem?
Thanks in advance