"Wait Attribute" Activity Does Not Trigger

I have tried many different ways, and maybe I am using the Activity the wrong way.

I have a page that when you click on the element, the visibility changes from 1 to 0. Nested in a Do While loop and using Get Attribute, I can detect this change - but it seems like the Wait Attribute activity is more appropriate here.

I use Find Element to assign a UIElement variable, then, use the Wait Attribute to find the “visibility” attribute as being “0”, but it never occurs. It always times out, even though I clicked on the button.

I tried in Chrome and in Internet Explorer. I even tried using the Drop Down to select an attribute, in this Case Inner HTML - this changes between these two strings, but still I could not get it to trigger (I manipulated the strings in many ways, in case it was malformed in how I entered it into the Wait Attribute activity.

I’m at a loss…

I’ve read some other forum posts and either they were not about Wait Attribute, went unanswered, or were not similar to my issue. Hoping one of you guys can help.

1 Like

Does the element disappear from the screen? Have you tried the activity “Wait Element Vanish” (or “Wait Image Vanish”)? And you’ve checked with Ui Explorer before and after clicking the element that the “visibility” attribute goes from 1 to 0? And you’ve double checked that “visibility” is the name of the attribute with Ui Explorer?

Actually the way you have used is correct but i have a doubt with the attibute visibility as it will have either visible or hidden rather to 1 or 0
kindly check once with the attribute
Cheers @sagacity

It does not show in UI Explorer - but I validated the the attribute changed using Get Attribute in a Do While loop.

I did discover something, I picked a random Attribute that doesn’t change, and it worked. So this is what it seems so far:

Only UI Explorer properties work here - so no go on “visibility”

It DOES see inner HTML, but, somehow I cannot get it to properly compare. I think because it is multi-line. You can’t copy/paste from UI Explorer, so, I outputted the value of InnerHTML to Output, then did a copy paste, but,this still did not work, and there were issues with quotes, etc, so, not sure how to use Inner HTML.

This is the copy pasta of that:

<a id="pushingTransactionsButton" href="javascript:void(0);" style="background: rgb(64, 211, 101); cursor: default; pointer-events: none; display: none;">
					<i class="fa fa-cloud-upload" aria-hidden="true"></i> Pushing Transactions
<a id="pushingTransactionsButton" href="javascript:void(0);" style="background: rgb(64, 211, 101); cursor: default; pointer-events: none;">
					<i class="fa fa-cloud-upload" aria-hidden="true"></i> Pushing Transactions

The first one is before clicked, the second would be after clicked. At no point could I get Wait Attribute to recognize any of these values. :confused: Its probably the way I’m referencing it, but, I’m still at a loss

@Palaniyappan I had done this. Works perfectly in a Do While loop using Get Attribute. Only Wait Attribute doesn’t work.

Correction - visibility DOES show in UI Explorer - so not sure again what is happening.

OK, so, shows in UI Explorer, but not the DROP DOWN attribute selector in “Wait Attribute”. So maybe only works with stuff in the dropdown, but, how to I check “innerHtml” (which shows in drfopdown) when it looks like this:

<a id="pushingTransactionsButton" href="javascript:void(0);" style="background: rgb(64, 211, 101); cursor: default; pointer-events: none;">
					<i class="fa fa-cloud-upload" aria-hidden="true"></i> Pushing Transactions

So the “Get Attribute” activity works fine - what if you stored the output of that activity in a variable and then use an IF statement to check the variable if the attribute is 0 or 1?

@x.Rei.Ai.x - Yes, I am currently doing that in a DO WHILE loop. The WAIT ATTRIBUTE, which is event driven, is more appropriate for what I am doing. Basically I’m monitoring the state of this element.

Bot comes on and I want it to wait until the element is “0”.

Once it is “0”, I want it to wait until it is “1” - then script should continue the rest of the code. Would be clean and legible with a WAIT ATTRIBUTE activity. The innerHTML property changes in the same manner as the visiility from 1 to 0 and back to 1, but, I don’t know how to make it recognize the value I want…

@sagacity I did some testing with Wait Attribute on attributes that were on web pages but not in the drop down in the predefined list of the activity. It seems to fail if the attribute is not in that predefined list. So your “visibility” attribute appears to not be working due to it not being in that drop down list.

Might I suggest using a “Wait Element Vanish” or “Wait Image Vanish” if the element disappears from the screen or changes the way it looks, respectively? You could also put the workflow in a “On Element Vanish” scope. Or play around with “Element Exists” for when that particular element appears (when the attribute changes from 1 to 0).

1 Like

Similarly, you can use Find Element, if the attribute can be part of the selector.

Not sure why the Wait Attribute isn’t working, though, as I have not used it much. Maybe it’s bugged.

1 Like

Yes, I use the “Find Element” activity to store the element in a UIELEMENT variable type, and carry that trough the loops.

I’m not sure how to make my

<a id="pushingTransactionsButton" href="javascript:void(0);" style="background: rgb(64, 211, 101); cursor: default; pointer-events: none;">
					<i class="fa fa-cloud-upload" aria-hidden="true"></i> Pushing Transactions

match whatever the “Wait Attribute” is seeing. Not shure how to check this,

@sagacity - Use the “Indicate on screen” feature of the “Find Element” activity on the element after you have clicked it and is the element when “visibility” is 0. That will get you the UiElement when it is that specific element. If the element does not exist, it will timeout after 30 seconds - but once it does exist, it will continue the workflow.

Alternatively, you could just edit the selector so that “visibility = ‘0’” rather than “1”.

I meant that you can use it to wait for an element with a specific attribute. Like if visibility=‘1’ in the selector, it will wait for it to appear. However, I seem to remember that a site I was working with where the hidden elements always showed up on the screen even though they were invisible. I can see what I did, and post a screenshot in case it helps.

@ClaytonM - I don’t see anywhere in the Find Element activity to specify an attribute; but thanks for the thought.

In this scenario, a site would have a loading image, where I needed to use the outerhtml.

Visible selector:

Invisible selector:

The difference in my case was the disply was block or none

Then for the loader, I used these steps:

I can’t remember if I tried Wait Attribute, but I did try many things and was not easy to figure out like yours.


1 Like

Sadly, its not a true test of is the element visible or not. The state is changed by the web application - when the button is pressed, it runs a background process, and when that completes the, visibility is set to 1 (its is 0 whilst processing).

If I could make it match the innerHTML, that changes as well, but, I’m not sure how to test for it. When I copy and paste the above <a id=“pushingTransactionButton” …etc etc into the Value of the Wait Attribute Activity, it never detects it.

Hi @sagacity

I had similar problem and please try with “get Attribute” instead “Wait Attribute” in your while loop, but before every “get Attribute” just put some delay of 1 second. You need to “refresh” your selector and as @ClaytonM said maybe “Wait Attribute” it’s bugged.
Please keep in mind that visibility is not always best choice because you don’t whole html behind and if this element is dynamically created or not. Depending of website, besides “visibility”, you can use “relative visibility”, “innerhtml” or “innertext” (usually last two are null if element is invisible).


1 Like

@Nikola_Drazic - Thanks. This was my solution to use Get Attribute - but Wait Attribute seemed like the appropriate activity in this case. I use “visibility” because the application uses that to set the state of its elements whilst processing and was an accurate way to monitor the process.

I’d like to use innerHTML, but, can’t seem to get it to match the text I enter for value. No matter what I do, it doesn’t work. Somehow related to VbCrLf or tab or something. So, sadly, I think its me (and my copy & paste) that is bugged rather than Wait Attribute.

Have you tried replacing the double quotes with &quot; when using innerhtml?
Look at my example of outerhtml above.