【发布时间】:2017-01-28 07:19:28
【问题描述】:
我想设置 Jenkins 以与 Web 应用程序交互并返回结果,但首先我要在网页上对其进行测试。
我只是想与 Random.org 交互,按一个按钮返回一个值,但我什至似乎无法打开网页本身。
我试过以下代码:
#Start-Process
$ie = New-Object -com InternetExplorer.Application
$ie.Navigate("https://www.random.org")
$ie.visible = $true
sleep 30
if( $ie.visible -eq $true)
{
echo "Random.org opened"
}
else
{
echo "Random.org did not open"
}
但这总是返回回声"Random.org did not open"。我现在意识到$ie.visible -eq $true 可能不是检查 jenkins 的最佳方法,因为它在后台运行并且看不到。有没有其他方法可以检查网页是否打开?
【问题讨论】:
标签: powershell jenkins automation automated-tests