How to Wait Until the CSS attribute changes


#1

Hi guys,

I would like to know how to proceed to next step only when the CSS property changes from “display: block” to “display: none”. Basically there’s a message “Loading…” and it would like to go to next step when this message disappears.

Sample HTML:
<div id="msgload" style="font-weight: bold; display: block;">Loading..</div>
<div id="msgload" style="font-weight: bold; display: none;"> Loading..</div>

Not sure if Wait Attribute or Wait Element can handle this. Any advice?

Thanks


Simple selector on website
#2

Hi,

I would suggest below approach.

Use - Get Attribute Activity to Get “relativeVisibility” of that element (i.e. your div with id “msgload”), This will return True when this div will be visible (display:block) and it will return False when it is hidden (display:none)

Use this activity inside “Scope Retry” activity and put “Is true” activity in condition for scope retry. (in “Is true” activity you need to pass variable which you will get from Get Attribute Activity)

Change property of “No of Retry” as per your scenario for scope retry.

This way your flow will wait till loading will be disappear.

Hope this will help.

Thank you,
Kuldip GOhil


#3

Hi kuldip can you please help me on this question
Question

in my case there is div and that div is by default display:none, i want to expand it and scrap the data so can i change the css from display:none to display:block;. stuck in this for almost 4-5 days. any help will be appreciate thanks StackoverflowQuestion


#4

Hello everyone

I’m facing the same issue but getting relativeVisibility is not working for me, it always returns false even when in the web html the div style shows block

any other aproach to this situation?

thank you in advance


#5

Provide “Wait element vanish” with “display:block”. It will work :grinning: