Get data from active tab in Google Chrome not first tab

Hi Experts

I am building an attended robot where I need to fetch data from a journey planner. That part is working fine.

However I have just realized that if using Google Chrome instead of Internet Explorer it is the data from the first tab/session of Google Chrome data is fetched from if the journey planner has been opened in multiple tabs.

Is there a way to get data from the “active” tab?

Hi @jacchr,
You can try to make Open Browse with new session with desired address and crape data from it.

Hi @Pablito

I do not think this is an option - this is an attended robot with user interaction. It is the end user opening the browser and looking up the journey plan - the process is triggered when the user clicks “expand details” in the browser. But if multiple journey plans have been opened in difference Chrome tabs it is always the data from the first tab that is extracted.

In the UiPath Explorer I can see that the hwnd property changes for each tab session - but I cannot seem to use this property in the selector. It works fine if adding hwnd=‘*’ in the selector. But as soon as I give it the hexadecimal 0x20790 it fails - I have also tried with the converted decimal 133008 (which is also the value the Get Attribute activity returns) but with the same result.

The thing you are referring to is property of the window. I’m not sure if this can be used somehow. But you may try to look for element called htmlwindowname which in fact should be related to the chrome tab. Here is the example:

Hi @Pablito

How did you find the htmlwindowname? It does not appear when I use the UiExplorer.

Which version of Studio do you have? I tested it on the latest preview release having two identical tabs opened in chrome.

I am using 2019.10.1 but I have also tried with the community edition running 2020.6.0 beta.

Hmmm I’m not sure if it’s something newly added but I tested it on latest preview which is 2020.10.0-1008

I have tried upgrading to 2020.10.0 as well - but I still don’t get the htmlwindow item. How did you create the selector?

I just click random element on one of two opened tabs and checked the selector in UI Explorer. Then goes to the top element on the tree which is related do chrome.

Strange I don’t get the htmlwindow option still - I only have app, title and url (url is under unselected items)

I’m not sure if it’s related but can you check the version of Chrome Extension installed? And version of chrome itself?

Running the latest Google Chrome 86.0.4240.75 and UiPath plugin 9.0.6824

I checked it more carefully and you’re right. Seems that this parameter is thrown only for the some pages (unfortunately not all). Sorry about that. I should check it on more pages.

Anyway you can try to work with anchors. In UiExplorer you can define an anchor and bind element you need to get with any characteristic element on the site which will exist only in such variation.

No worries it was worth the try… However I think that I am might able to use the URL instead as this provides a unique reference for each search for the specific website.

Thanks for your guidance :slight_smile:

1 Like