Cannot click button on a newly opened Chrome tab

Hi everyone,

I went through many relevant posts that are quite similar, but I still can’t seem to solve this issue. I’m fairly new to UiPath, so please bear with me.

Among other things, my StudioX project is supposed to open Google Chrome, navigate to a page, click each link on the page to open it in a new tab, click a button in the new tab to reveal certain text, extract the text, then close the new tab.

My problem is that the program goes to the newly opened tab successfully, and the button is visible, but the following error occurs: “Activity Click ‘About’ (N Click) failed: Could not find the user-interface (UI) element for this action.”

Here’s how I’m doing it:

  1. A ‘Use Application/Browser’ activity opens a page in a new tab (tab 1) with the following properties:
  • Options → Close: NAppCloseMode.Never
  • Options → Open: NAppOpenMode.Always
  • Options → Window attach mode: Application instance
  1. Within the ‘Use Application/Browser’ activity, a ‘Click’ activity with the following properties opens a second page in a new tab (tab 2):
  • Options → Activate: True
  • Options → Key modifiers: NKeyModifiers.Ctrl
  1. Within the ‘Use Application/Browser’ activity, a 2nd ‘Use Application/Browser’ activity uses the ‘Click’ activity’s output element as input element with the following properties:
  • Input element: _out_NClick_1__OutUiElement
  • Options → Close: NAppCloseMode.Never
  • Options → Open: NAppOpenMode.Never
  • Options → Window attach mode: Application instance
  1. Within the nested ‘Use Application/Browser’ activity, a ‘Keyboard Shortcuts’ activity with ‘Ctrl+2’ combination goes to tab 2

  2. Within the 2nd (nested) ‘Use Application/Browser’ activity, a ‘Click’ activity with the following properties clicks an element to reveal the text I need to extract:

Please note:

  1. I’m opening the link in a new tab since navigating back and forth in the same tab seems to mess with the ‘For Each UI Element’ activity.
  2. I’m omitting the title attribute in the last step (step 5: ‘Click’ activity), because the title changes with each link

I’d appreciate any help. Thank you!

Hi @Omar_Shazly,

Can you try to make your selector dynamic by selecting different attribute for Click activity.
by navigating to UI Explorer

Hope this will solve your issue.

Happy Automation,
@Vinit_Kawle

Use dynamic selectors and dont omit the title , make it dynamic instead of omitting…

Hi @Vinit_Kawle

Thank you for your help. What do you mean by selecting a different attribute for the Click activity?

This is what I see when I open the Click activity’s window selector property in UI Explorer:

Hi @Sree_Krishnan_vellinezhi

Thank you for your reply. Do you mean that I should make the tab’s title dynamic in the ‘Window selector’ property of the ‘Click’ activity? If so, how do I do that if I only know parts of the dynamic text?

I’m not sure if the following helps:
The new tab’s title (1) always begins with a sub-string that I extract from the first tab and (2) always ends with “LinkedIn”

Hi @Omar_Shazly

Firstly change the properties for both use application/browser activity for both chrome tabs as below.

First use application/browser activity -
Close - Never
Open - IfNotOpen
Window attach mode - Single window
Input mode - Simulate

Second use application/browser activity -
Close - Always
Open - Always
Window attach mode - Application Instance
Input mode - Simulate

Don’t make any changes for the click activity that you are using inside the second use application/browser activity.

Hope it helps!!

Hello @Omar_Shazly - Dynamic in the sense, is in the above window with the following selector:

<html app='chrome.exe' title='Digital Innovation Srl:Overview:LinkedIn'/> 
  • It will only work for the ‘Digital Innovation Srl’ webpage on LinkedIn. If you want to work with multiple webpages with the same structure, you need to make the title dyanamic to adapt to the run-time changes i.e. add wildcards to the title.
<html app='chrome.exe' title='*Overview:LinkedIn'>
  • This will fit to any page with the above selector structure. If you are crawling over all LinkedIn, then my it more dynamic by keeping only ‘*LinkedIn’ in the selector.

Also, in the above UiPath Forum Selector, I suppose you are trying to crawl on Help Button, so the selector should have title as ‘*Help/StudioX - UiPath Community Forum’ and it should also mention the element details for the button you want to click - something like:

<html app='chrome.exe' title='*Help/StudioX - UiPath Community Forum'>
<webctrl aaname='Help' text='Help' cls='xyz'/>

Its just a sample and the actual selector may vary.

Thanks.

This is incorrect. It’s the UI element you clicked that ends up in that variable. What you need to do for the 2nd Use Application/Browser is attach to the new window/tab using selectors, not an input element.

2 Likes

Thank you, @postwick. This worked perfectly. Nothing else needed to change.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.