I’m trying to automate a scenario where in a website I’ll login and extract details from the present tab. After extraction I’m using click activity which opens a new tab and I need to extract the details from that tab and close that tab. In the first tab (main tab) there are 10 elements. I need to extract the details of those 10 elements. Every time I click the element a new tab with a new url is being opened. I am unable to automate this scenario using modern activities as the tab is opening with a new url. Can someone help. Thanks in advance.
Just a suggestion, why not take the details of the 10 elements including the URL of each element and then loop thru all elements each time opening it in a new browser, extract what you need, close the browser and go to the next element.
We have to use another Use application\browser activity for the second webpage.
→ Use the Use application\browser activity to open the first webpage.
Change the Properties for this Use application\browser activity as below,
- Open → Always
- Close → Never
- Input mode → Simulate
- Window attach mode → Single window
→ Insert click activity to click on element which redirects to second webpage.
→ After click activity insert second Use application\browser activity and indicate on the second webpage.
Change the properties for Second Use application\browser activity as below,
- Open → IfNotOpen
- Close → Always
- Input mode → Simulate
- Window attach mode → Application Instance
→ Inside Use application\browser activity insert activities to move forward in the automation.
Check the below image for Use application\browser activity properties,
Hope it helps!!
Hi @mkankatala Thanks for the reply .
This solution is failing because every time a new element is clicked, a new tab in the same browser with a new URL is being opened. The URL of the new tab in the browser here is dynamic.
Hi @avejr748 , Thanks for the reply .
Yes this works for this case here, but I’m concerned in future if i get a scenario where I have to deal with dynamic tabs. That’s the main motive of me asking for this doubt.
Can someone help me with this. Thanks in advance.
Can you please clarify or give more concrete examples? Even if it’s dynamic, the main page will always have to generate the dynamic URLs which you can always then get before opening the other tabs.
You don’t necessary need to know the url. Since the tab is opened automatically by your automation, set the “Open” property to “Never” and you can clear the “Browser URL” field. It is only mandatory if you want to open the page by the “Use Application/Browser” activity. Now you need only to adjust the Selector of the “Use Application/Browser” to make sure your new tab is detected properly.
Hi @efelantti "Now you need only to adjust the Selector of the “Use Application/Browser” to make sure your new tab is detected properly. " Can you be more specific.
Can you please elaborate this part. I didn’t get you here.
You can use Title and/or Url properties along with wildcard(s) in the window selector.
The main page, will always have in its source html the generated URLs for the dynamic links. For example in the main page source code, there will be
<a href=.../dynamiclink.php>dynamiclink 1</a>
<a href=.../dynamiclink2.html>dynamiclink 2</a>
Can we do that in the modern activities as well as the selectors are partial inside “use application/browser” activity ?
Yes this works. But further I can’t upadate the title and url as the selectors are partial inside “Use Application/Browser”. We need to again open the new browser window to do the next automation part. I was trying to use the same browser as of the main url.
Yes. You need a second “Use App/Browser” for the new tab.