Reputation: 31
I am trying to automate a workflow in windows using WinAppDriver and Selenium. Below is the code that I am using to initialize the WinAppDrier:
AppiumOptions appiumOptions = new AppiumOptions();
appiumOptions.AddAdditionalCapability("app", "Root");
_deskTopDriver = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appiumOptions);
And now when I am trying to search something in the search bar present in the Bottom taskbar in windows its giving me below exception and the code written is also present below:
_desktopDriver.FindElementByClassName("SearchButton").Click();
while executing this line it gives below Exception.
OpenQA.Selenium.WebDriverException
The HTTP request to the remote WebDriver server for URL http://127.0.0.1:4723/session/460BD012-523B-4400-8E01-7E09F21BA77B/element timed out after 60 seconds.
at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Appium.AppiumDriver`1.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Appium.AppiumDriver`1.FindElementByClassName(String className)
I am running a SpecFlow scenario, the strange thing is when I run the code for Sceanrio A this code works fine but when I run it for scenario B the code fails at the same line? How is that possible, because taskbar is visible in both the scenarios, and the workflow is also the same. I mean the method in which the above code is present is the same, I am just recalling the method, but in Scenario A it passes and in scenario B it fails.
Can anyone help me out to understand what is going on here? How can I resolve the issue?
Stack: C#, SpecFlow, Selenium, WinAppDriver.
Below are the versions of the Nugget packages in the project:
<PackageReference Include="Appium.WebDriver" Version="4.1.1" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="SpecFlow" Version="3.4.8" />
<PackageReference Include="SpecFlow.xUnit" Version="3.4.8" />
I tried increasing the timeout but that is not helping out.
I also tried Evaluating the expression in the rider IDE, it is giving StackOverflow exception when I evaluate the above code.
As the code and method is same it should work as expected, like how it is working in Scenario A it should work in Scenario B but its giving session timeout exception.
Upvotes: 0
Views: 329