How to get changing attributes from a web-page?

Hi guys,

I’m trying to perform a click activity on an element in a web application that is provided by a client I need to extract some text values from these web-page for particular inputs before that I need to expand a cascde tree which I did using Anchor base and click image and is working fine.

But extracting text from this element is not working as the get full text activity is not able to identify the selector.

1 Like

Did we try with Screen scrapping from design tab in studio

Cheers @batBot

Sorry guys I couldn’t type my entire issue. :roll_eyes: above.

I’m trying to perform a click activity on an element in a web application that is provided by a client I need to extract some text values from these web-page for particular input, before that I need to expand a cascade tree which I did using Anchor base and click image and is working fine.

But extracting text from this element is not working as the get full text activity is not able to identify the selector. The aaname=’ W252785PF900’ value changes for every input.

I tried to pass “*” inside aaname but then it extracts some other text instead of the desired text, this occur because the selector of this element changes when we modify the aaname.
Its only able to identify the element if we provide the aaname with that particular value. But the value changes for each input and there is no way to pass this to aaname.

I tried using Anchor base and get full text but it returns some other text.
I tried using OCR and screen scraping it returns the value but it is completely mixed up with other elements that are present in the screen.

This is the selector: The value (W252785PF900) changes each time!

Is there any way I can get this aanme at run-time so that I can pass it as a variable to aaname to get the text form the element.

1 Like

This is the selector!

html app=‘chrome.exe’ title=’’ />
webctrl aaname=’ W252785PF900’ parentid='ext-gen
’ tag=‘DIV’ /

Awesome
Did we try with GET ATTRIBUTE activity there by getting the value of aaname attribute as a string variable

Cheers @batBot

1 Like

@Palaniyappan thank you for the idea, let me try with it but I have one question.

If i indicate an element with Get ATTRIBUTE activity and pass (aaname) and store it in a variable I can pass this var’ to the selector. But the next time when the element changes will the get ATTRIBUTE activity able to correctly identify it?

1 Like

Yah it could for sure
Cheers @batBot

@Palaniyappan

So if the element of the Get ATTRIBUTE activity changes for the 2nd loop will the activity identify the element for 2nd time? or it will show selector not found?

This is because the selector of the Get ATTRIBUTE activity will also be different for the 2nd loop.

1 Like

Fine
Replace the dynamic part of selector with wildcard and try once pls

@batBot

@Palaniyappan As i said the selector for Get ATTRIBUTE activity changes very loop but the ‘*’ is not working properly.

Example: Here i have to get aaname of two elements in one loop itself.

Element 1 W25C94808000 the selector is (html app=‘chrome.exe’ title=’’ />
webctrl aaname=’ W25C94808000’ parentid='ext-gen
’ tag=‘DIV’ )

Example 2 W25C94808031 the selector is (html app=‘chrome.exe’ title=’’ />
webctrl aaname=’ W25C94808031’ parentid='ext-gen
’ tag=‘DIV’ /)

here if i provide the selector as
(html app=‘chrome.exe’ title=’*’ />
webctrl aaname=’ ’ parentid='ext-gen’ tag=‘DIV’ /) it will not return any text.

if i provide as
(html app=‘chrome.exe’ title=’’ />
webctrl aaname=’ W25
’ parentid=‘ext-gen*’ tag=‘DIV’ /)
It returns a correct value for the first element but for the second element it is wrong.

Any way to get both these elements correctly.

Thank you :slight_smile:

Please note that there is ‘*’ in between!

1 Like

did we try mentioning like this
html app=‘chrome.exe’ title=’ ’ />
webctrl aaname=’W25*’ parentid=‘ext-gen*’ tag=‘DIV’ /)

Cheers @batBot

1 Like

HI batbot,
Have you tried using the Repair button on the Edit Selector window?

  1. Click Indicate Element
  2. Select the element you want to Click
  3. Click Repair
  4. Again, select the element you want to Click
  5. A prompt would appear notifying you that the live element has been fixed or something
  6. Click Ok, then click Validate to check the live element will be clicked correctly.

Let me know if this works for you too.

@Palaniyappan

yes i tried giving '’ to html app=‘chrome.exe’ title=’ ’ />
webctrl aaname=’W25
’ parentid=‘ext-gen*’ tag=‘DIV’

The issue is there are three elements that start with W25 so it only returns the first element every time.

Elements are; 1.W25C94808000 2. W25C94808031 3. W25C94855025

I also checked with row and col value in Ui explorer but there are also same for all elements expect the aaname change.

hmm…it would work actually
fine kindly replace fully with asterik for aaname = ‘*’ and try once
Cheers @batBot

@jcvsalinas

I did that but it only works for loop 1 in loop 2 the aaname of the elements change and the selector won’t be able to identify the elements.

@Palaniyappan Yes buddy this would work as it returned the value correctly but only for the first element, for second and third element it returns the first value.

kindly replace fully with asterik for aaname = ‘*’ and try once- tried it already but at that time the selector is returning nothing as the entire chrome page is highlighted.

I would share the complete selector details in a while.

I wonder why it didnt buddy
Fine
can i have a screenshot of how this was mentioned

Cheers @batBot