The XPath expression you are using looks suspicious. The expression //div[@class=’xpath expression’] will find an “div” element with a class attribute set to “xpath expression”, meaning the “div” has to look like this: <div class=”xpath expression”>Some content here</div>. Please make sure this is how your HTML element really looks like. The other problem might be that this HTML element is dynamically created from JavaScript code and the Web application you’re testing is glitchy and fails to create that element. If the “presenceOfElementLocated” condition fails, it means that the element doesn’t even exist in the page yet, regardless of whether it is clickable or not.

--

Passionate software engineer, proud parent of two, author of the OpenTest functional testing tool for web, mobile and APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrian Theodorescu

Adrian Theodorescu

16 Followers

Passionate software engineer, proud parent of two, author of the OpenTest functional testing tool for web, mobile and APIs.