Error in test execution due to web element/object not found

Issue :


Error in execution due to web element/object not found.


Issue Description:


When executing test cases, an error can occur if a web element or object is not found on the page. This typically happens when the element's identifier or properties (such as ID, class, or XPath) gets changed with time.


Solution:

1. Recheck the test case to ensure that the object has been successfully captured in the test step during recording. 
2. If the test object is dynamic and changes with time, use ByText keywords in test case to handle it during test execution. These keywords locate the object by its name on the application and hence, any internal property change cannot affect the test case. 
Use this article to get detailed info on how to handle ByText keywords for dynamic objects.

Issue: Web Element/Object Not Found error when using the ByText keyword 


This typically happens due to discrepancies in entering the the element's name in TextToSearch field of the ByText keyword, such as spelling or case mismatches. To resolve this,



  • Verify Spelling:

    Ensure that the spelling of the web element or object is correct in the keyword. For example, if you are targeting a button named "Sign in," make sure to enter "Sign in" exactly as it appears on the web page. Any deviation in spelling can cause the element to go undetected.

  • Match Case Sensitivity:

    Remember that the ByText keyword is case-sensitive. This means that the exact case of the web element's name must be matched. For instance, if the button is labeled "Sign in," entering "sign in" in the keyword may result in an error. Always ensure that the capitalization matches exactly.

By following these steps, you can resolve issues related to "web elements not found" during test execution, ensuring that your test cases run smoothly in Opkey.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article