Exception thrown executing coded step: 'Connect to pop-up window : 'about:blank''. Exception occurred waiting for the new browser to connect.

1 Answer 49 Views
General Discussions
sugantha
Top achievements
Rank 1
sugantha asked on 24 Aug 2023, 03:51 AM
In Amazon link if new browser is clicked record and play back doesnt work it is erroring Exception thrown executing coded step: 'Connect to pop-up window : 'about:blank''.
Exception occurred waiting for the new browser to connect. error
Plamen Mitrev
Telerik team
commented on 24 Aug 2023, 09:19 AM

Hi Sugantha, could you please share more details about your test and the environment where you run it? Did you record a Web test against www.amazon.com and as part of the automation scenario, it opens a pop-up window with "about:blank: url?

It would be very helpful to understand the exact steps to reproduce the issue or even better, if you can share a sample Test Studio project that shows it. Thank you!

sugantha
Top achievements
Rank 1
commented on 24 Aug 2023, 09:23 AM

Hi Plamen,

 

Yes I used www.amazon.com  and when i clicked on a bag image it opens up a new browser when it is recorderd and played i got the error so instead of About Blank URL i tied using the below code

[CodedStep(@"Connect to pop-up window : 'https://www.amazon.in/FUR-JADEN-Backpack-Compartment-Organizer/dp/B0BYSZ3TKW/ref=sr_1_1_sspa?crid=1CRDJ62BS3C1E&keywords=backpack+for+men&qid=1692850187&sprefix=bag+pack+for+man%2Caps%2C253&sr=8-1-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1'")]
        public void poc1_CodedStep4()
        {
            // Connect to pop-up window : 'about:blank'
            //Manager.AddPdfPortToUrlIfNeeded("https://www.amazon.in/FUR-JADEN-Backpack-Compartment-Organizer/dp/B0BYSZ3TKW/ref=sr_1_1_sspa?crid=1CRDJ62BS3C1E&keywords=backpack+for+men&qid=1692850187&sprefix=bag+pack+for+man%2Caps%2C253&sr=8-1-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1");
            string urlWithPort = Manager.AddPdfPortToUrlIfNeeded("https://www.amazon.in/FUR-JADEN-Backpack-Compartment-Organizer/dp/B0BYSZ3TKW/ref=sr_1_1_sspa?crid=1CRDJ62BS3C1E&keywords=backpack+for+men&qid=1692850187&sprefix=bag+pack+for+man%2Caps%2C253&sr=8-1-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1");
            Manager.WaitForNewBrowserConnect(urlWithPort, false, 25000);
            Manager.ActiveBrowser.WaitUntilReady();
         }

        [CodedStep(@"Click 'SponsoredAdImage'")]
        public void poc1_CodedStep5()
        {
            // Click 'SponsoredAdImage'
            ActiveBrowser.Window.SetFocus();
            Pages.AmazonInBagPackForMan.SponsoredAdImage.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementCenterAtWindowCenter);
            Pages.AmazonInBagPackForMan.SponsoredAdImage.MouseClick(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter);

        }

still it did not work

                          

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 24 Aug 2023, 10:39 AM

Hello Sugantha,

Thank you for the clarifications in the comment. I was able to reproduce the same behavior on my end and created a sample web test that successfully connects to the pop-up. You can find it attached to this post and you can see how I fixed the connect to pop-up step.

When you open a item from the basket, it opens in a new tab. Initially, this tab is blank. Right after that it makes a request to the product page and populates the tab with the actual information and the URL is updated. I took the new URL and updated it in the recorded Test Studio step.

The URL is dynamic, so pasting it an looking for exact match will not work reliably. That is why I enable the "IsUrlPartial" option and trimmed the dynamic part of the URL. The only risk that this presents is if there is another tab that matches the same partial URL and that is currently open. 

Let me know if your have any follow up question regarding this approach or the attached web test and I will be happy to help.

Regards,
Plamen Mitrev
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Tags
General Discussions
Asked by
sugantha
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or