Use of if else

i am working on a project where i have a keyword excel list, then my RPA is searching all the keywords in a website one by one, if it gets any search result it’s clicking on the search result then again doing another keyword search. But whenever it’s not getting any search result it’s stopped working cause it’s not getting anything to click on the search result. So i want to use a if else so that if i get any search result it will click on the result otherwise it will ignore clicking then repeat agin searching other keywords.
Main(Autosaved).xaml (18.3 KB)

if possible i would like to add a counter that will count how many keyword it didn’t get search result, at end of the RPA process it will show a message box.

After Searching if some results found then what have to do ?

then have to click on the search result.

on all images or the 1st one only ?

first one only

i mean if you search for an image named cow then if you gets any result then you will click on the result, if you don’t get any search result when searching cow then you have to move forward to next keyword.

You can use ‘Element Exists’ property which returns boolean value. You can use this value under an if condition to click only if its true.

Let me know if that’s what you are looking for.

Rammohan B.

Could you please show me where to write the code exactly by opening my xml file that i uploaded? @Rammohan91