TestProject Forum
Powered by leading experts in the test automation community

How Do i go by elements that appear only once in a test

There are some elements that appear only when a user logs in the 1st time, tutorial screen of a sorts, so the test will always pass when a user is logging in the 1st time, but when they are already logged in, the test will fail because the tutorial will not be showed.

In inteliJ i would work around this by implementing an if (if(elemen.isDisplayed){Actions} else{} for that screen but in test project, how do i go about it?

Hi Allan!

The way to handle elements that appears only on certain conditions is to use the actions from the"Visible Elements Opeartions" addon.

For example, the action “Click if visible”, will click on the element only if it appears in the DOM. In case that the element is not visible, the action will not fail the step.

Is that make sense?

Kind regards,

Yes it does, let me try it out.
Thanks Alot

Sure Allan, let me know if you will need my help with that :wink: