jeudi 4 juillet 2019

Is there a way to read dialog text using UI Automation from a Web Application?

I am trying to read text from a dialog box inside a web application using UI Automation.

I achieved the same inside a WPF application. There was a dialog box inside a WPF application and I used UI Automation to achieve read text from it using below code,

AutomationElement dlg = appElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.LocalizedControlTypeProperty, "Dialog"));
AutomationElement dlgText = dlg.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text));

I expect to get the same result inside a Web application. I am having trouble to read data from dialog box inside the web application using above method. Can some one please let me know if i am making any mistake? Or is there any better way to do it?




Aucun commentaire:

Enregistrer un commentaire