Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win app driver not working in Selenium Webdriver Typescript #1988

Open
laksman2003 opened this issue Mar 26, 2024 · 11 comments
Open

Win app driver not working in Selenium Webdriver Typescript #1988

laksman2003 opened this issue Mar 26, 2024 · 11 comments

Comments

@laksman2003
Copy link

Trying to use Win App Driver with Typescript to automate a Windows Desktop App. And when I run the below code in any test framework I get a 400 error in win app driver and I see a error message browser is mandatory eventhough am testing a desktop app.

And when I give a some value for browserName it still gives 400 error in win app driver with error message either app or appLevelTopWindow should be given

app is Root so I can iterate through all available apps. The same approach works with C# Webdriver and with C# as coding language but not working with Typescript with Selenium Webdriver and Selenium Appium

const capabilities = {
  platformName: 'Windows',
  deviceName: 'WindowsPC',
  app: 'Root' 
};

await driver.startWithCapabilities(capabilities);

Below are libraries used in node js
Selenium-webdriver: 4.18.1
Selenium-appium: 4.1.22

@anunay1
Copy link

anunay1 commented Mar 27, 2024

Selenium 4 will not work, you need to downgrade to selenium 3

@laksman2003
Copy link
Author

laksman2003 commented Apr 2, 2024

Its is working after downgrading to Selenium "selenium-webdriver": "3.6.0" and "selenium-appium": "1.0.2" But its very slow in finding new windows which appear in app. But while using .net C# it is very fast in finding the same windows with same selectors.

Is there a reason why Windows App Driver is quite slow (over 2 minutes) in finding new windows with Typescript but faster with C# .net Webdriver? C# .Net webdriver version am using is Selenium.WebDriver - 3.141.0 and Appium.WebDriver - 4.4.5

@MagdelineNg
Copy link

MagdelineNg commented Apr 8, 2024

@anunay1 Is Selenium 4 totally out of support? I am writing a Python script to automate a Win app that uses MS WebView2, and i want to automate that webview using Selenium 4's Attach to Session feature, similar to this issue

Edit: It seems like there are users using Selenium 4 #1668

@anunay1
Copy link

anunay1 commented Apr 8, 2024

Yes it is unfortunately.

@anunay1
Copy link

anunay1 commented Apr 8, 2024

And python language binding has other issues like action classes does not work properly. You might face issues like right click and all.

@MagdelineNg
Copy link

MagdelineNg commented Apr 8, 2024

@anunay1 Yep, I realised problems in locating elements using the Selenium webdrivers when I upgrade to Selenium 4. For example,

    time_and_language_menu_bar = settings_driver.find_element_by_xpath(config_file["xpaths"]["TimeAndLanguageMenuBar"])   
    print("time_and_language_menu_bar: ", time_and_language_menu_bar)  #returns a dictionary instead of the WebElement
    time_and_language_menu_bar.click()  #error

Are there any ways to automate the WebView2 using Selenium 3, as I understand WinAppDriver is not able to automate WebViews? Or are there any ways to overcome these issues with Selenium 4?

@anunay1
Copy link

anunay1 commented Apr 8, 2024

I don't know what your compulsion is with python is? Is it your project call? But moving to C# will be a good option. And follow the link in the ticket you have mentioned above.

@MagdelineNg
Copy link

@anunay1 hi, my project is able to switch to C#, but I would still have to use selenium 3 as winappdriver does not support selenium 4. Will automating Microsoft webview be a problem with selenium 3 (I am referring to this link https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver#attaching-microsoft-edge-webdriver-to-the-launched-webview2-app)

@anunay1
Copy link

anunay1 commented Apr 19, 2024

I don't think so. As long as you are on selenium 3.

@MagdelineNg
Copy link

@anunay1 Hi, Selenium 3 does not actually support webview2 according to MicrosoftEdge/WebView2Feedback#3892 (comment) . Will WinAppDriver work with Selenium 4 in C# Nunit?

@anunay1
Copy link

anunay1 commented Apr 20, 2024

I don't know I have not tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants