Chrome browser creates new tab however switches back to original tab

Hello everyone,
I’m facing issue while developing RE framework. I use company web portal on chrome browser. As part of framework flow, the original tab opens a report in new tab of chrome. So, I developed logic to work on this new tab and download report on PC. However, whenever I run the framework flow and it reaches to the point where it triggers new tab for report, it switches back to original tab. So, whatvever logic which was developed for new tab, the bot tries to work those acticities in original tab instead of the new tab. I tries, attach browser, activate, attach window, swtich tab ctl+tab etc options, but the flow still switches to original tab. Becuase of this issue, i can not download the report from new tab. Is there anyway, that the flow will stay in the new chrome tab and wont go to original tab?? Kindly help.

@Nandkumar
Put Use App/Browser inside original Use App/Browser

Regards

1 Like

Hi @michael.zura, the new tab does not have specific address. Its dynamic everytime I generate new report so the address varies. it only has specific header name which specifies report name.

Hi @Nandkumar
In case of classic activities follow below steps:

  1. Open Browser
    • Set the necessary properties to open the web portal in Chrome. Store the output in a variable, “Browser”.
  2. Click or relevant activity
    • Use an activity like “Click” to trigger the opening of the report in a new tab.
  3. Attach Browser
    • Configure the “Attach Browser” activity, and provide the “Browser” variable as input.
  4. Add the necessary activities within the “Attach Browser” scope to interact with elements, download the report, or perform any other required actions in the new tab.

In case of Modern activities:

  1. Use Application/ Browser activity two times and change the required properties:
    In the first Use application/Browser keep the property of Window Attach Mode in Single Window and second application keep the property in Application Instance.

Or else you can use Go to URL activity and give the specific URL.

Hope it helps!!
Regards,

@Nandkumar
You will have to inspect the elements of new tab to identify.

regards

Hi @Nandkumar

To avoid the process being switch to the previous tab, can you implement a logical snippet in between to close the current tab, so that the upcoming processing will be facilitated in a new tab instance?

You can use the Send Hotkey activity to achieve this. The keys will be the combination of Ctrl+W (or you can use Ctrl+F4 as well)

Hope this helps,
Best Regards.

Hi @Parvathy, thanks for your inputs. I’m using the Modern activities. The only issues with suggeted proposal is, the new window will always have new address while loading report and its dynamic. And ‘Use application/Browser’ needs specific address right? So how do we still use this activity of Use applcation/Browser?

Thanks for your inputs @arjunshenoy. I would need the original tab for the next queue transaction. Original tab operates for working on all queue transactions one by one. Once I download report from new tab, I will close the new tab and then will continue to work with original tab by loading new queue info. So, i cant close the original tab.

@Nandkumar

Well, in that case, can you check whether you can work with an incognito tab opened in an independent window, so that you can process the individual transactions & come back to the original tab?

If you wish to proceed with this, you can set the Private option as true in the Open Browser activity.

Hope this helps,
Best Regards.

Hi @Nandkumar

The new URL which opens is dynamic right try using wildcards (*) whichever part is dynamic. It will solve your query.
Hope it helps!!
Regards,

1 Like

Dear @michael.zura @Parvathy and @arjunshenoy,
The issue is finally solved using combination of solutions that you had provided.
first frost Michael zura that i need to use acticity ‘Use app/browser’ inside ‘Use app/browser’. And to solve the issue of dynamic new tab, I used the solution of wild card (*) for the random keywords in new tab keeping constant name as it is. So, now RPA works on the new tab without switching to original tab. Thanks a lot for your guidance and support.

1 Like