简体   繁体   中英

RemoteWebElement.SendKeys works on computer 1 but not computer 2?

We have a .NET 6.0 UITest solution that we run in Visual Studio 2022. It starts a WinForm application and tries to set username and password. It does activate and place caret in the boxes and SendKey do work on computer 1 but not computer 2?

I have tried to add Clear and Click before and even manually click the field but it will still not be set by the test.

The version of WinAppDriver.exe is 1.2.2009.2003 on both computers, it is also executed as admin just like VS2022.

Simple code exeample:

var loginForm = session.FindElementByAccessibilityId("frmMain");
var usernameEdit = loginForm?.FindElementByXPath("//Edit[@AutomationId=\"txtUser\"]");
var passwordEdit = loginForm?.FindElementByName("passwordText");
                    
usernameEdit?.SendKeys(optionalUsername.IsNullOrEmpty() ? settings.LoginSettings.OrbitAdminAnvandare.Namn : "TestUser");

passwordEdit?.SendKeys(optionalPassword.IsNullOrEmpty() ? settings.LoginSettings.OrbitAdminAnvandare.Losenord : "TestPassword");

I'm suspecting some kind of rights issues?

This was due to using TeamViewer that probably use a keyboard that do not work with WinAppDriver.exe.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM