You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MessageDialog is not attached to current window popups, but ContentDialog is.
The easiest way to work with alerts at the moment is to replace MessageDialog with ContentDialog.
For example, in our test app I had
varnoWifiDialog=new MessageDialog("Here's the content/string.","Hello!"){Title="No wifi connection",Content="Check connection and try again"};
noWifiDialog.Commands.Add(new UICommand("Ok",this.CommandHandlers));
noWifiDialog.ShowAsync();
So I replaced it with:
varnoWifiDialog=new ContentDialog(){Title="No wifi connection",Content="Check connection and try again",PrimaryButtonText="Ok"};
noWifiDialog.ShowAsync();
Now the ContentDialog is shown in Winium.Inspector. It's content is appended to the bottom of the tree. And now you can interact with it just like with the rest of interface.
This is how it can be done in python (which should be easy to translate to C#):
By.XNAME='xname'# this is for example only, in real cases attach Automation Properties to buttons and use them to locate elementsdialog=driver.find_element_by_class_name('Windows.UI.Xaml.Controls.ContentDialog')
print(dialog.find_element(By.XNAME, 'Title').text) # not that it is preferred to attach AutomationProperties and use AutomationId or Name instead of xnameprint(dialog.find_element(By.XNAME, 'Content').text)
dialog.find_element(By.XNAME, 'Button1Host').click()
The text was updated successfully, but these errors were encountered: