White Automation framework throws an exception when using “White.Core.Desktop” Class

故事扮演 提交于 2019-12-11 11:40:45

问题


I am using White Framework for automation. when I trying to get desktop instance I got exception "The type initializer for 'White.Core.Desktop' threw an exception."

My code looks like :

var window = White.Core.Desktop.Instance.Windows().Find(obj => obj.Title.Contains("TestAppHome"));

Is there any way to capture the window without exception that is without using White.Core.Desktop class?

Any help would be greatly appreciated !


回答1:


Try this one:

List<White.Core.UIItems.WindowItems.Window> windows = WindowFactory.Desktop.DesktopWindows();
var window = windows.Find(w => w.Title.Contains("TestAppHome"));


来源:https://stackoverflow.com/questions/22478583/white-automation-framework-throws-an-exception-when-using-white-core-desktop-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!