Azure login screen
To start, the way our login prompt is set up for WPF, Microsoft generates it and we have no real control/access for it. When running our automation tests we get this error 90% of the time "Failed to locate opened application window with appId". How can I get this resolved? WAD version 1.1.1809
You need to create a root session and then switched to the opened window. check FAQ
@anunay1 We tried that, it didn't work.
Are the elements shown in inspect.exe for login azure
Are the elements shown in inspect.exe for login azure
Yes they are showing. We ended up doing this for it to work. It's probably not a good way of going about this but it works: ` if (session == null)
{
try
{
// Start a new session by creating a new instance of the WindowsDriver object,
// we pass the WinAppDriver url and the appiumOptions parameters we created.
session = new WindowsDriver
curWindow = session.CurrentWindowHandle;
loginWindow = session.WindowHandles[0];
//System.Diagnostics.Trace.WriteLine("Application Window: " + session.CurrentWindowHandle + " Login Window: " + loginWindow + " Window Handle count: " + session.WindowHandles.Count());
}
catch(Exception ex)
{
// Assert.IsNotNull(session);
do
{
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appiumOptions);
curWindow = session.CurrentWindowHandle;
}while(session == null);
}
}`
`[TestMethod]
public void PrePopulated_Test()
{
System.Diagnostics.Trace.WriteLine("PrePopulated_Test");
if(session != null)
{
// Click prepopulated account name
// session.FindElementByName(fix.UserName).Click();
loginTests.Login(fix.UserName, fix.PassWord, "loginWindow");
session.SwitchTo().Window(session.WindowHandles[0]);
}
else
{
Assert.Equals(session, null);
}
}`
@anunay1 Now it doesn't work again. There doesn't appear to be a cure all fix for this.