【问题标题】:Can Win32::GuiTest detect error popups thrown by Excel?Win32::GuiTest 可以检测 Excel 抛出的错误弹出窗口吗?
【发布时间】:2015-02-19 09:45:06
【问题描述】:

我正在使用Win32::GuiTest

以下是我的代码,我将其发送到 Excel 文件,我尝试写入的单元格不允许 20 作为有效值,并以弹出窗口的形式抛出异常。

my $command = "{DOWN}{RIGHT}{DOWN}{RIGHT}{DOWN}{RIGHT}{DOWN}";
SendKeys($command);
SendKeys("20");

有没有办法使用 Perl 捕获那些错误(代码/文本)消息?

【问题讨论】:

    标签: perl win32gui


    【解决方案1】:

    文档说

    SendKeys 总是在发送击键后返回。没有办法 判断应用程序是否在函数处理这些键时 返回。

    您可能会发现 FindWindowLike 和 GetChildWindows 很有帮助。

    见:http://www.perlmonks.org/bare/?node_id=282956

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-16
      • 1970-01-01
      • 1970-01-01
      • 2014-02-09
      相关资源
      最近更新 更多