Hi team,
My application is a Windows desktop application, and I use OpenCppCoverage to gain testing coverage.
For example: opencppcoverage --export_type html:coverage --cover_children --modules $ExePath --source $SrcPath – poetry run robot -d results --variable MyApplication:$ExePath $PathToTestcases
I encountered a very strange issue: when I add the argument --cover_children to the OpenCppCoverage command to call up robot framework to run the ui test, then I randomly encounter the problems from robot framework “AssertionError: Element could not be found/selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters” etc
Here are more details:
-
This error occurs not with a specific element, but randomly with the tested elements. If I remove the argument --cover_children from OpenCppCoverage command, the problem disappears, and everything works well (I am sure that the XPath/automation ID are correct). but I need the argument --cover_children to gain the test coverage.
-
I have used the keywords Log Source and Save Appium Screenshot, I can see the element both in the source and screenshot, but Robot Framework reports that it cannot find/locate it.
-
This issue occurs even when, for the same element,
the first line: AL . Element Should Be Enabled ${Locator} passes,
and the second line: AL . Wait For And Mouse Over And Click Element ${Locator} double_click=${Double_Click} fails because the element didn’t appear (see screenshots 1). I have adjusted the waiting timeout to 30 seconds, but it still fails (the element can still be found in the log source and screenshot from the report. see Screenshot 2 and 3 to compare in the log source). -
I have updated to the latest version of Robot Framework (v7.3.2), and I still encounter this issue.
-
This issue occurs not only in my application, I have tried it with another application, and the bug also occurs randomly during the testing.
Does anyone have a suggestion or idea about the causes of the issue and how to solve it? Alternatively, how can I debug this issue? I’m pretty much stuck, as this problem occurs randomly, but it does happen consistently across the test plan
Please feel free to let me know if you need anything else, a big Thanks in advance:)