How to get the parentId an UI element

I am new to UiPath. I would like to understand from where the parentId in the is identified… If i want to change to some other value how can I do this. For example, I would like to get the text from an image on Amazon. when I recorded it is working , but when I run it fails.
How to understand the attributes of an UI element and change them

Hi @tulasi26ram,

Welcome to UiPath.

Please go through the below link to understand the ui attributes and selectors ho to work.If you have any issues let me know.


Regards,
Omkar P

2 Likes

Hi @Reddy_Paluri,

Thank you for your quick reply. But I have a question regarding the attributes of the . For example when screen scrap the image on Amazon home page, I got the selector as
. I just want to understand from where (is it the webpage the parentid attribute is we are getting) the parentid attribute is adding to the selector. If we want to edit this attribute where can i check in the webpage… Can you help me to understand this.

@tulasi26ram You might want to use Inspect on the Webpage and check the html elements the web page shows. The parentid attribute recognised by the UiExplorer may be present but with some different attribute name.

1 Like

Hi @tulasi26ram,

Pls find the below amazon parent id through UiExplorer

Regards,
Omkar P

1 Like

@supermanPunch,

So there is no exact tagname to correlate parentid in the webpage?? and this parentid attribute is generated by uiexplorer?? Not from the HTML content of the webpage… is this your are saying?? Am i correct…

@Reddy_Paluri,

I understand that parentid is the attribute of uiexplorer. But if I want to change to some other value where can i look. For eg: if we want to change the name attribute of particular textbox, we look at the html content and change accordingly. In the same way where can i look for the parentid in the webpage??

Also, I am not able to get the OCR text from amazon site for any images. It is saying that empty text is returning. I tried this way in the sequence

  1. Open webbrowser
  2. Get OCR text activity
  3. write line activity
  4. message box activity to print the OCR text on the image

I tried for all most all images on the amazon home page. But no success.

@tulasi26ram Can you show us which Image were you trying extract the data?

@supermanPunch,

Please navigate to amazon.in and you can find this image in the home page.

@tulasi26ram I tried using Get OCR Text and I was able to get the Value.

1 Like

@supermanPunch,

I used my selector as

@supermanPunch,

Can you post the solution here. Also I would like you to post the selector for OCR text

@tulasi26ram I guess these many attributes are sufficient for it to be recognised :

@supermanPunch,

R u closing the browser after the run?? Bcz I am closing it. When I re-run, the parentid is keep on changing and getting the error .

@tulasi26ram Yes you are right. The Selector keeps on changing :sweat_smile:, The Alternative way would be take the Constant Element in the Page, Check it’s parent Id, if it matches with the parent id of the Text that you need then we can First Use Get Attribute to get the Parent Id of the Constant element and then use that parent id inside the Get OCR Text to get the text.
I will be developing the same in my end, you can try developing the same as well.

@tulasi26ram But can I ask why are you doing this? Is it for Learning purposes? Because the amazon website is a dynamic website and it keeps changing it’s contents every now and then or atleast every season, So it might not work Everytime. :sweat_smile:

@supermanPunch,

Yes. I am doing this as a practice as I am novice to RPA and UiPath. I started 2 days ago.

@tulasi26ram Ok. Good. In that case you just need to know the methods that you can use to get the value.

For particularly in this case, You need to Fetch the Value of the text, you can actually use aaname attribute. But if you think that value changes every time then you cannot use it. Instead you need to go for the kind of method as I have mentioned above to handle the dynamics.

Hi @tulasi26ram,

Could you pls try in this way.

My question starts here only. I am not sure how to retrieve the parent id of an element. Can you please help me in understanding how to get the parent id of a particular element and where can i check in the browser