Verify rotating banners on website

How can i verify rotating banners displaying in the website?

What exactly do you want to verify?


My problem is when I hit the URL, there can be any banner out of 3 . How can I validate that banner exist or not?
Can we provide multiple banner xpath ?

I think you will have to loop to check each possible banner. There are two loop options: a for loop, like for (int cnt = 0; cnt < 3; cnt++) or a while loop, like:

def hasFound = false
while (!hasFound) {

When you “find” the correct banner, you break out of for loop or set hasFound equal true to stop the while loop. If you go with the while loop, you will have to provide an exit strategy if none of the banners are found. If you go with the for loop, you may also have to use a switch case block to allow for different xpaths (or maybe a List<String> of xpaths).

Perhaps something similar to the following is also an idea.

Thanks Let me try this.