Hi,
The calculator test was failing on my Windows 11 Pro laptop.
Though the Calculator App was launched successfully, I got the below error after launch:
System.InvalidOperationException
HResult=0x80131509
Message=Unable to find Windows.UI.Core.CoreWindow|WinUIDesktopWin32WindowClass in {Calculator, ApplicationFrameWindow, }
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.AppiumDriver1..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
at CalculatorTest.CalculatorSession.Setup(TestContext context) in C:\YWinAppDriver\YWinAppDriver-0.3.1.0\examples\CalculatorTest\CalculatorSession.cs:line 42
at CalculatorTest.ScenarioStandard.ClassInitialize(TestContext context) in C:\YWinAppDriver\YWinAppDriver-0.3.1.0\examples\CalculatorTest\ScenarioStandard.cs:line 94
I had to add else loop after line 54 in UIObjectHelper.cs to make it work
The below is how my code looks now
...
...
50 if (currentTimeout < 0 && element == null)
51 {
52 throw new UIObjectNotFoundException(
53 $"Timeout after ${timeoutInMilliseconds}: Unable to find {string.Join("|", classNames)} in {topWindow}");
54 }
55 else // by Saif
56 {
57 break;
58 }
...
...
Just want a confirmation, is this correct? Or am I missing something?
It maybe the calculator app is changed, and the existing matching is not enough to match the app. The app will always fail in this case, and need code fix it.
timeout. The matching depends on a timer. You may workaround the issue either increasing the 300ms timeout
or using title matching
Hi, The calculator test was failing on my Windows 11 Pro laptop.
Though the Calculator App was launched successfully, I got the below error after launch:
System.InvalidOperationException HResult=0x80131509 Message=Unable to find Windows.UI.Core.CoreWindow|WinUIDesktopWin32WindowClass in {Calculator, ApplicationFrameWindow, } Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary
2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.AppiumDriver
1..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) at CalculatorTest.CalculatorSession.Setup(TestContext context) in C:\YWinAppDriver\YWinAppDriver-0.3.1.0\examples\CalculatorTest\CalculatorSession.cs:line 42 at CalculatorTest.ScenarioStandard.ClassInitialize(TestContext context) in C:\YWinAppDriver\YWinAppDriver-0.3.1.0\examples\CalculatorTest\ScenarioStandard.cs:line 94I had to add else loop after line 54 in UIObjectHelper.cs to make it work The below is how my code looks now ... ... 50 if (currentTimeout < 0 && element == null) 51 { 52 throw new UIObjectNotFoundException( 53 $"Timeout after ${timeoutInMilliseconds}: Unable to find {string.Join("|", classNames)} in {topWindow}"); 54 } 55 else // by Saif 56 { 57 break; 58 } ... ...
Just want a confirmation, is this correct? Or am I missing something?
Thanks, Saif.