Need help/idea with verification on dynamic pages


Currently I am testing a website with a specific flow of several pages. However a specific page is dynamic based on the selections of the previous pages.

This is my case:
I have 6+1 pages.
Page 1-2-3-4-5 & 7 are always the same pages.
On page 2 and 4 I can make choices which impact if I get a page 6 or not.

My goal is to verify I am on the correct page after page 5.
This means I am either on page 6 or page 7.
The thing is, both page 6 and 7 do not have the same title or text in them. And I want to verify if I am on either of those.

Is there a way I can use an verification = text OR text ?
I looked around the net but can’t seem to find a solution that would work for me.

Kind regards,

You probably need to get the content of the title element and do the comparison on that.

You either need to create the TestObject yourself or use JavaScript to get it directly.

If you’d like an OR check, the most straight-forward way would be something like:

String title = ... // get title of page (could be page 6 or page 7)
assert title.equals("Welcome to Page 6!") || title.equals("Welcome to Page 7!")

Thx for the replies.
I will try that or statement tomorrow morning when I am at work.

Ill keep you posted :slight_smile:

Got around this a bit later then i thought. But your solution works. Thanks :slight_smile:

1 Like