Open liannah opened 5 years ago
Share your code, the error is obvious: driver can not find an element.
Thank you for the reply.
It is a simple code actually, and that is why I did not understand why it can and than after some time cannot run the same code.
[TestMethod] public void Model() { session.FindElementByAccessibilityId("Startup").Click(); session.FindElementByAccessibilityId("bodyPanel").Click(); }
Simple way to create a session, and also I do session.Quit() after each session completed.
DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", EmpAppId); appCapabilities.SetCapability("deviceName", "WindowsPC"); session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities); Assert.IsNotNull(session); session.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(1.5));
EmpAppId provided by path.
The problem is that after one successful run the error says it cannot find the element "startup". My best guess after some research is that the application starts the run in the background and thus WInAppDriver fails to recognize the elements.
I have created a test case, which was successfully launched. However, after certain time and trying different builts, the test case did not run anymore. I have returned everything back to the way it was running, however no result. The error is as follows: {"status":7,"value":{"error":"no such element","message":"An element could not be located on the page using the given search parameters."}}. I want to imply one more time, that before the application was running without any errors or problems. Any guesses why such issue can occur or any help is greatly appreciated.