Level 3 Exercise 2 Get Text for Hash Number SOOOO Slow!


#1

Hi All,

I’m trying to get the hash number from the SHA1 website.

The Hash number seems to be generated quickly enough but when I use the Get Text activity to retrieve the generated Hash number the process just sits there for Ages (>1 minute) just to get a text field that’s already been generated?

This is my GetHashCode workflow

SHA1Online_GetHashCode.xaml (9.1 KB)

In the Get text activity I do have the WaitForReady property set to INTERACTIVE but I think that’s OK. In the documentation I’m not really sure what the difference is between the INTERACTIVE and COMPLETE.

image

Maybe I should be using a different activity to get the data?


#2

Hello @charliefik,

Try using WaitForReady as NONE and see if that works!


#3

I’m having a different problem now, and it doesn’t matter which watiforready value I use

image

I get the above message when I try and extract a hash code from a SHA1-online.com page that is clean (no previous attempts at entering a string to generate a hash code.

if I run it on a page that has had a hash code generated before then it does pull a hash code out but it’s the original one that was already on the page and not the current one.

The field that holds the hash code doesn’t exist on a ‘clean’ web page so it looks like it just is not waiting for the field to exist and then throwing an exception.

Could someone please just run the xaml and see if they are having the same issue. If not maybe its my internet connection being very slow?

SHA1Online_GetHashCode.xaml (9.1 KB)


#4

I’ve tried putting a text exists looking for Result in this element

which seems to activate but then I get the same issue when it tries to retrieve the hash code.

I don’t understand why this is not working as it was working before!!!


#5

Try putting a delay before you get the text out of there, that would avoid it from picking the previous value.
I’m assuming you’ve made your selector dynamic?
“Result fr sha1 : *”


#6

The text exists is using the selector

<webctrl id='sha1-title' tag='DIV' />

and is looking for the text Result which seems to work fine (and is basically the delay)

***correction doesn’t work fine as doesn’t find “Result” if I message box the output of the text exists activity it returns False ("either way the message box gives plenty of time for the hash to be generated so it should be available)

***correction after I discovered the beauty of UiExplorer selectors: should have used UiExplorer to generate the selector (probably)

The get text which is failing is now waiting for that text exists to activate before starting and its’ selector is

<webctrl id='result-sha1' tag='SPAN' />

I did an attach to live element with a different hash so this selector should be fine (I think. but it’s not)

SHA1Online_GetHashCode.xaml (9.8 KB)


#7

I just tried it with the web scraping wizard which basically opens up a new browser and then does exactly the same and it has the same error message. Could someone please try the code and see if they are having the same issue if so it might be an exciting mega problem instead of just me getting a selector wrong.


#8

The issue is with the selectors.
Please find below attached xaml and change selectors as per the selector mentioned in xaml.
SHA1Online_GetHashCode.xaml (9.3 KB)


#9

Firstly obviously you are amazing!

Please please please explain why you need the aaname field. If you click on indicate element it’s not part of the generated selector and if you then generate another hash and do indicate element (which should get uipath to generate a suitable dynamic selector, hopefully) that also doesn’t include the aaname. Also you have set it to * so it could be anything which is obviously necessary as it’s holding the hash code. My question is how did you know that element was needed.

It’s not just the the aaname it’s also the Title element again how did you know this was needed, ARRRGGHHH!

This is the automatically generated selector (by clicking on the hash code on the web page which doesn’t work)
<webctrl id='result-sha1' tag='SPAN' />

and this is your selector (which works)
<html title='SHA1 online' />
<webctrl id='result-sha1' tag='SPAN' aaname='*' />


#10

I stated the same in my last reply.LOL :stuck_out_tongue:

Should have been more clear.I was assuming you already have the aaname hence i told you to write “Result for sha1 : *”

Well sometimes, UiPath fails to find a reliable selector, in that case it is the developer who has to make sure he does what is necessary in order to make it reliable, whenever there is an issue with the selector, best way to go about it is use UiExplorer and use variable combinations of attributes, which suit best in your case and make the selector generic and reliable!
aaname attributes helps a lot in giving the direct reference to the element you want to find!
You’ll be using UiExplorer a lot in future :wink:

Cheers!


#11

Sorry Rishabh I didn’t get the * reference in your previous post (the earlier one not the last one) thanks too for the help!

I can see that having a dynamic selector to the field that you actually want to retrieve is probably a good idea, I just thought that the ‘indicate on screen’ functionality had magic powers that would pick all the necessary elements and make them dynamic if necessary (given an alternate example to choose).


#12

By the way NOT SLOW ANYMORE!! now it can actually find something with the working selector.


#13

Just for completeness to this question. I went into UiExplorer and pressed the ‘select target element’ icon in the top left corner

image

to pick out the hash code it generated this selector (does work)

image

This doesn’t have any dynamic elements but it does have the title element which is not generated when you select using the Get Text selector (indicate on screen)

image

Which generates this selector with the missing Title element (doesn’t work)

image

Not sure what the morale of this story is except that from the previous posts dynamic selectors are good

From this:

Get Text ‘Indicate on screen’ generated selectors are bad (maybe)
UiExplorer ‘Select target element’ selectors are good (maybe)

PS.
I generated the same not working selector when using the Web Recording wizard so that also generates ‘bad’ selectors (maybe)

Go UiExplorer!!!


#14

Generate selector using UiExplorer. Try making the selectors dynamic.


#15

Sorry got another questions regarding this.

The dynamic selector part that we put in originally was

aaname=’*’

my question is this

I can understand having a dynamic selector that has some common text (between selectors) and then a * like

aaname=‘SomeString*’

so that it can match any variation with the same lets say, starting string, but if we just set the whole value to * as in

aaname=’*’

are we actually adding anything to the selector as that element can have any value so it may as well not be included (I may very well not have a clue what I’m talking about so please forgive me)


#16

The hash code value generated is present in the aaname attribute. So the value in aaname changes everytime the data typed is different. So making it “*” helps us.


#17

The only value you could have for aaname is “*” as it’s a hash code so there is no consistancy between values.

But my point is that if you just use ‘*’ the value could be anything including nothing so what do we gain by having the aaname element in the selector as this selector that doesn’t have the aaname element also works

image

Maybe by having the aaname element in, that insures that the aaname element is available even if we don’t care what value it has? But * can also be nothing so by saying it can have any value including nothing (not being there) what do we gain by including it.

Dynamic selectors are great (obviously) my question is having a dynamic selector with just a * how does that improve the selector (does it mean that aaname has to be present in some form or because * could also be nothing does it not mean that)