Automating WPF application using WinAppDriver

%3CLINGO-SUB%20id%3D%22lingo-sub-1899845%22%20slang%3D%22en-US%22%3EAutomating%20WPF%20application%20using%20WinAppDriver%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1899845%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20automating%20WPF%20application%20using%20Win%20App%20Driver%2C%20When%20I%20am%20trying%20to%20launch%20the%20WPF%20application%20I%20am%20getting%20error%20%22Failed%20to%20locate%20opened%20application%20window%20with%20appId%22.%20My%20WPF%20application%20is%20'Click%20Once%20Application'.%20My%20code%20is%20like%3A%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3Eprivate%20string%20wpfAppid%20%3D%20%40%22%3CA%20href%3D%22https%3A%2F%2Fptyqa.testleginoint.bis%2FMain%2FTenance.Shell.Application%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fptyqa.testleginoint.bis%2FMain%2FTenance.Shell.Application%3C%2FA%3E%22%3B%3CBR%20%2F%3Eprotected%20static%20OpenQA.Selenium.Appium.Windows.WindowsDriver%3CWINDOWSELEMENT%3E%20driver%3B%3C%2FWINDOWSELEMENT%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EAppiumOptions%20opt%20%3D%20new%20AppiumOptions()%3B%3CBR%20%2F%3Eopt.AddAdditionalCapability(%22app%22%2C%20wpfAppid)%3B%3CBR%20%2F%3Eopt.AddAdditionalCapability(%22deviceName%22%2C%20%22WindowsPC%22)%3B%3CBR%20%2F%3Edriver%20%3D%20new%20WindowsDriver%3CWINDOWSELEMENT%3E(new%20Uri(%22%3CA%20href%3D%22http%3A%2F%2F127.0.0.1%3A4723%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2F127.0.0.1%3A4723%3C%2FA%3E%22)%2C%20opt%2CTimeSpan.FromMinutes%20(20))%3B%3C%2FWINDOWSELEMENT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22driver%22%20is%20null.%3CBR%20%2F%3Eis%20there%20any%20other%20way%20to%20launch%20the%20'Click%20once'%20applications.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am automating WPF application using Win App Driver, When I am trying to launch the WPF application I am getting error "Failed to locate opened application window with appId". My WPF application is 'Click Once Application'. My code is like:


 
private string wpfAppid = @"https://ptyqa.testleginoint.bis/Main/Tenance.Shell.Application";
protected static OpenQA.Selenium.Appium.Windows.WindowsDriver<WindowsElement> driver;


AppiumOptions opt = new AppiumOptions();
opt.AddAdditionalCapability("app", wpfAppid);
opt.AddAdditionalCapability("deviceName", "WindowsPC");
driver = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), opt,TimeSpan.FromMinutes (20));

 

"driver" is null.
is there any other way to launch the 'Click once' applications.

0 Replies