【问题标题】:Teststack.white - How to click the save button in Internet explorerTeststack.white - 如何在 Internet Explorer 中单击保存按钮
【发布时间】:2023-04-02 14:42:02
【问题描述】:

浏览器:Internet Explorer

框架:Teststack.white

Visual Studio:2017 社区

(转载: 导航到https://www.nuget.org/packages/Newtonsoft.Json/ 点击手动下载)

我使用 Teststack.white 自动化框架,我需要在 Internet Explorer 窗口中按保存按钮。

我可以通过

在页面中找到工具栏
TestStack.White.UIItems.WindowStripControls.ToolStrip toolStrip = i.e. Get<TestStack.White.UIItems.WindowStripControls.ToolStrip> ("Notification");

但无法识别并单击“保存”的拆分按钮。我能够 单击“打开并取消”按钮。

【问题讨论】:

  • 你解决了吗?
  • 不,我确实面临同样的问题。
  • 你能贴一张你的浏览器窗口的截图,显示保存按钮,也许还有一些代码?谢谢

标签: white-framework


【解决方案1】:

我们在 Watin 中找不到拆分按钮,所以我找到了另一种方法。只需将 _HdlScreen 作为 Watin Current 桌面实例传递,传递 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中执行点击保存按钮事件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-01
    • 1970-01-01
    • 2021-11-27
    • 1970-01-01
    • 1970-01-01
    • 2011-04-16
    • 1970-01-01
    相关资源
    最近更新 更多