Error with Get Text activity

Hi,

I am trying to obtain file permissions for Google Drive files by using the Get Text activity to extract the part in red (see below). However, when testing this on different files, I get an error saying: Cannot find the UI element corresponding to this selector. I have checked the selector but it doesn’t change for different files.

1 Like

Hey @keshana_t,

You need to check whether the element is present for those files.

Make sure selector is valid for all scenarios.

If possible please share the selector.

Thanks :slight_smile:

1 Like

Hi @Nithinkrishna,

Thanks for your reply - Yes the element is present for the files I am testing. Is there a way to make it dynamic because in some cases the element will be present but it might state something else, for example, UNRESTRICTED instead of RESTRICTED.

1 Like

Yep that’s what is important.

In the access state value just use wildcard *

Don’t use the exact word restricted or unrestricted. Just replace it with *

Thanks :slight_smile:

1 Like

@keshana_t

You need to check the selector, It may be dynamic

So check take the selector of working element and get the selector which is failing

based upon that you can build a dynamic selector

Hope this helps you

Thanks

1 Like

Hi @Nithinkrishna,

Thank you - Where can I find the access state value? My selector is as below:

1 Like

Hi @Srini84,

Thanks, but I did check the selector and it is the same for both the working and failing element

@keshana_t,

Looks great. You are not using it.

But I can see id param which may change could you please replace it with *

Thanks :slight_smile:

1 Like

Thanks @Nithinkrishna, it doesn’t return an error now, however, it doesn’t give me an output when it should say ‘Restricted’ in my Write Text File activity output.

1 Like

Could you please show me a validated selector please.

I can see the selector is not validated in this case

That may be helpful.

Thanks :+1:

1 Like

Hi @Nithinkrishna,

Please see below. I would also like to make the title dynamic because I’d like to use this for different files but changing it to *** - Google Drive** invalidates the selector.

1 Like

Just give *Google Drive*

This will make your selector generic to multiple files.

FYI - Meaning of using * is to replace one, multiple or no characters.

Thanks :+1:

1 Like

Thanks @Nithinkrishna - I have made the changes below but it now invalidates the selector and I still do not get an output (it should say Restricted) in my Write Text File activity.

Apologies for the many questions - never quite done this before!

1 Like

Not a problem @keshana_t,

A sample workaround is coming for you. Meanwhile, If you can just explain what are you actually trying to do in drive.

Thanks :slight_smile:

1 Like

Thanks so much @Nithinkrishna.

I want to extract the permissions for each google drive file that I have. So the idea is to input the URL to the file in UiPath and for UiPath to output the access restrictions for the file.

To get this information, you need to click the three vertical dots in your file


Then click on Share and a pop up box will appear as below. From here, I would like to capture whatever is mentioned in the red box below, for example, this could be Restricted or Unrestricted.

Let me know if that doesn’t make sense!

1 Like

Hey @keshana_t,

Cool. Got your scenario.

Please try the below selector :slight_smile:

<html app='chrome.exe' title='*Google Drive' />
<webctrl tag='IFRAME' tabindex='0' />
<webctrl tag='B' />

Let know if you still face issue !

Thanks :+1:

1 Like

Thanks @Nithinkrishna - unfortunately I get the same issue:

1 Like

Are you using any timeout value in Get Text or is it blank ?

1 Like

It is blank @Nithinkrishna - should I use a timeout value?

1 Like

No, let me create a workflow sample and see.

Hope you don’t mind me taking 5 to 10mins

Cheers :+1:

1 Like