Safari pause until there is change in html div class

I am trying to automate the uploading of files to a web page. The way the page is designed means that when an file is has finished uploading, the only indication that it has finished is with the appearance/change of a div-class in the html.

In the html before the upload

After the upload completes it adds "HAS IMAGE" and changes to:

What I want to be able to do is to run a PAUSE UNTIL the new div class appears so I know I can continue with the rest of the macro.

I did see this solution but couldn't work out out to convert it to work in this situtation:

Any help greatly appreciated

while someone more knowledgeable appears, you can use a Pause Until: condition Found Image:


Thank you for the suggestion, however there is no unique image element on the page that appears after each upload so unfortunately that method would not work in this scenario.

What I have managed to do as a workaround for the time being is via an applescript (which i understand!!), but I would prefer the javascript option as it is a much cleaner method by the looks of it.

The script looks for the element using a javascript command. If the element is not on the page then nothing is returned, the script waits 3 seconds, then tries again, giving up after 20 loops. If the element appears on the page then the script returns true and finishes.

1 Like

What is the issue?
If you will post the HTML code (in a Code Block) around the section where the new <civ> appears, I will take a look at it.
Be sure to identify the the new <civ>.

Actually in the end I realized I could tweak the applescript version (removing the repeat part) and use it in a Pause Until statement