Selenium/C# - 通知用户需要手动操作

Selenium/C# - Inform user of manual step required

我正在创建一个测试套件,它会自动运行我们内部 Web 应用程序中的一些页面。我 运行 遇到的问题是有一个测试步骤需要用户手动完成。有没有办法在测试期间通过强制弹出窗口或其他可以告诉用户 "Now you need to do this to continue the test" 的方式通知用户?我将继续尝试找到一种方法来自动执行该步骤,但在那之前这将是一个临时修复。

提前致谢!

您可以看到 the answers to this question about executing scripts 并使用 window.alert

js.ExecuteScript("window.alert('Please enter the foo in the bar')");

将此与 waiting for a condition 结合使用以检查操作是否已完成。如果操作未正确执行,您可以 Assert.Inconclusive("Manual action did not resolve as expected") 向测试开发人员发出信号,表明测试需要修复,或者向分析师表明结果应该被忽略。