Squish 将应用程序上下文设置为由正在测试的 aut 启动

Squish set application context to aut started by aut under test

在python中,是否可以将应用程序上下文设置为被测GUI调用的第二个gui。

例如:我们使用 startApplication 启动一个名为 test1.exe 的应用程序。单击 text1.exe GUI 中的按钮会调用另一个名为 test2.exe.

的 GUI 应用程序

现在可以将应用程序上下文设置为 test2.exe GUI 吗?

Squish for Qt 要求子进程由 squish_dir/bin/startaut.exe 启动(然后使用 attachToApplication()), squish_dir/bin/dllpreload.exe(自动连接),或者内置钩子编译进去。

在某些情况下,您可以通过执行以下操作(记录在 Additional Setup for Hooking up Qt Sub-Processes on Windows Non-Invasively 中)来逃脱:

  • test2.exe重命名为test2_.exe
  • squish_for_qt_dir/bin/dllpreload.exe复制到与[=相同的文件夹中108=] 并重命名为 test2.exe.

这样 test1.exe 将调用 test2.exe,现在 dllpreload.exe in "disguise",这将导致 dllpreload.exe开始test2_.exe.

如果 test1.exe 需要 [=19= 的进程 ID,则此方法将不起作用]test2.exe,或者如果 test2.exe 需要其进程 ID父进程,因为在这两种情况下都是重命名的 dllpreload.exe。如果 test1.exetest2_.exe[=61,这也不起作用=] 尝试通过它们的 stdout、stderr、stdin 流相互通信(因为 dllpreload.exe 不设置它)。

尝试在测试套件设置中选择 'Hook in to sub-processes...'。