Find Element or Element Exists or On Element Appear

Hi All,

I am trying to figure out which of this activity is better for my scenario - Find Element or Element Exists or On Element Appear.

I am running a search from a website, there can be two scenario.
1 scenario is the product can be searched and it continue to loop and search for the next product.
2nd scenario is that the product cannot be found and a pop out message (standard message) will appear. I need to capture this message for this product and maybe email to myself to know that this product was not found. And continue to click ok, and continue to search for the next product.

Should i be using On Element Appear? How do i create a loop back to search for the next product?
Do i use the “If” activity but i don’t see how to link this up.

My Flow should be if Element appear, email myself, click ok, search for next product. Else if element does not exists continue with the next step.

Hi @minthodology

Not sure if this answers your question. I have attached a file which does a delay (after determining how long it takes for search results to appear) and then followed by Element Exists.
You may use the On Element Appear as well if you prefer it to be more dynamic.

SearchElements.xaml (6.2 KB)


1 Like

@minthodology if you go with element exists activity this will give you output as Boolean variable such that you can use if condition where if it exists it goes to then sections otherwise else.
-find element it gives you output as Uielement
And I’m not sure about element appear l’ve to look about that.

Hi @Gluon thanks for sharing the file.
I added this to my work flow and it was able to capture the element and perform the sequence i added in the “then”. However, somehow it also starts to perform the sequences in the Else which got everything stuck.

Is there some issues which i need to rectify?

Would you mind sharing you workflow file with me, i might be able to take a closer look.

I am so sorry, the data is a little sensitive hence i cannot share my workflow with you.
Is there any settings which is need to amend in your .xaml besides the sequences in the Then and Else?

It is alright if you mask the sensitive data (meaning to say you remove any sensitive variable or elements to search). There should not be any need for amendments and i suspect that the “then” sequence you are hitting will be from the first element. Thereafter, the “else” sequence you are hitting is most likely from the next element in your array (or list)


Oh there will always be one element only so should i edit the assign to just ELEMENTS = {“Element”}

Nope you can remove it and the “for each” activity, replace the target of element exists to the element itself.