cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in attaching to chrome tabs

Pranav
Level 3

Hi,

I am facing difficulty while attaching to different tabs on the chrome browser. So when I am trying to pass all the windows titles possible in a collection data item and then passing that collection as the property for Attach on Windows Title (as Collection) this was working for me on IE but not working on Chrome.


Kindly help me if you have any solution for this.



------------------------------
Pranav
SE
Infosys
Asia/Kolkata
------------------------------
1 BEST ANSWER

Helpful Answers

diane.sanzone
Level 7
Hi Pranav,

I've experienced the same because of the way that chrome spawns multiple processes even for a single window.  If using the child index value doesn't work, you can also try looping through process IDs.  You can use the "Read Memory Stats" action in the Environment utility to return the process IDs for all Chrome processes. The output is a collection which includes much data, including the PID (process ID) for the given application.  It will also ALWAYS include the "idle" process with a PID of 0, so you should include a decision statement to ignore/skip that process ID in your attaching. 
Once you have the collection of all the chrome processes/PIDs, create a loop to detach from your current connection, then attach to the next PID in the list.  You can then include a wait stage for an element on the correct tab.  If it is not found (exception occurs or wait timeout), detach from that PID and go to the next item in the collection. 

I tried to upload a screenshot of my object doing this, but unfortunately it is blocked in my organization.  If you have any issues/questions please reply here and I'll do my best to explain better.

------------------------------
Diane Sanzone
------------------------------

View answer in original post

2 REPLIES 2

ritansh.jatwani
Level 9
Hi @Pranav,

You can use Child Index property to attach to the relevant tab.​

------------------------------
Ritansh Jatwani Senior Consultant
Consultant
EY
Gurgaon
------------------------------

diane.sanzone
Level 7
Hi Pranav,

I've experienced the same because of the way that chrome spawns multiple processes even for a single window.  If using the child index value doesn't work, you can also try looping through process IDs.  You can use the "Read Memory Stats" action in the Environment utility to return the process IDs for all Chrome processes. The output is a collection which includes much data, including the PID (process ID) for the given application.  It will also ALWAYS include the "idle" process with a PID of 0, so you should include a decision statement to ignore/skip that process ID in your attaching. 
Once you have the collection of all the chrome processes/PIDs, create a loop to detach from your current connection, then attach to the next PID in the list.  You can then include a wait stage for an element on the correct tab.  If it is not found (exception occurs or wait timeout), detach from that PID and go to the next item in the collection. 

I tried to upload a screenshot of my object doing this, but unfortunately it is blocked in my organization.  If you have any issues/questions please reply here and I'll do my best to explain better.

------------------------------
Diane Sanzone
------------------------------