Adrian Theodorescu
1 min readMar 26, 2019

--

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.

--

--

Adrian Theodorescu

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