cancel
Showing results for 
Search instead for 
Did you mean: 

How to close an opened tab on chrome Browser?

RekhaDaisy
Level 2
Hi, Am pretty much new to Blue Prism and trying to have a hands on experience in automating a web application.

My use case is as below :
Log into a web application using chrome browser and when user clicks on a particular pdf link on the web page, it opens up on a separate tab and then the tab opened should be closed.

I have created a browser based application modeller , selected type of application as "Browser which is already running", gave title of the page.

Close button(x) was identified and added as an element and using navigate stage, I tried to close this tab opened but it did not work(Used Attach action to have the web page attached as well). Can anyone share me the logic to close a newly opened tab within the same browser ?

------------------------------
Rekha Daisy
------------------------------
1 REPLY 1

Hi Rekha,

You can try to send the keyboard shortcut "CTRL+w" using the 'Send Global Keys' action with key parameter as '^(w)'. If you need to rework on the application and attach to the any other window instance, you can attach back to the application instance by using Attach action again post closing the tab. 

In order to properly use the 'Send Global Key' action, ensure the following:

- Spy one element which is the window element where you need to apply this shortcut key. Spy this element using 'Win32' mode
- Now use a 'Navigate' stage and use the following actions with a delay of 0.5 to 1 second between them. The first action is 'Activate' which will take in the window element that you spied using 'Win32' and the second action is the 'Send Global Keys' which you need to apply over the root application element (Element that by default appears when you complete the Application Modeler Configuration and is always at at the top of the hierarchy)

NOTE:- Remember two things:

- You must always keep the window activated and on foreground for the Global Send Keys to work.
- Never use the interval period on the Global Send Keys action while you are sending special characters like Alt, Ctrl, Shift, Enter etc.


Let us know if that helps.

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.