浏览器: Internet explorer
框架: Teststack.white
Visual studio: 2017社区
(复制:导航到https://www.nuget.org/packages/Newtonsoft.Json/,单击手动下载)
我使用的是Teststack.white自动化框架,我需要在浏览器窗口中点击保存按钮。
我可以通过以下方式在页面中找到工具栏
TestStack.White.UIItems.WindowStripControls.ToolStrip toolStrip = i.e. Get<TestStack.White.UIItems.WindowStripControls.ToolStrip> ("Notification");但不能识别并点击“保存”的拆分按钮。我可以单击“打开并取消”按钮。
发布于 2021-11-19 14:23:51
我们在Watin中找不到Split Button,所以我找到了另一种方法。只需传递_HdlScreen作为Watin当前桌面实例,传递IE标题
_HdlScreen = Desktop.Instance.Windows().Find(obj => obj.Title.ToLower().Contains(("My Site - Internet Explorer").ToLower()));
(_HdlScreen.GetElement(TestStack.White.UIItems.Finders.SearchCriteria.ByText("Save")).GetCurrentPattern(System.Windows.Automation.InvokePattern.Pattern) as System.Windows.Automation.InvokePattern).Invoke()它将在IE中执行单击保存按钮事件。
https://stackoverflow.com/questions/48905046
复制相似问题