与“存在”相关的问题;
我正在为基于网络的应用程序设计一个自动化框架。我使用“Exist”方法来检查用户是否已正确登录应用程序。像这样的事情:
If Browser("XXX").Page("YYY").WebElement("Either you have entered").Exist(0)
Then
Browser("XXX").Page("YYY").Image("btnok").Click
fnReset = false
Else
If Browser("XXX").Page("YYY").WebElement("Account Search").Exist(0) Then
fnReset = true
End If
Browser("XXX").Page("YYY").Sync
End If
如果在首先命中 IF
部分时输入了无效的用户名/密码,则此代码可以正常工作。
但是,当我尝试使用有效的用户名/密码时,IF
条件步骤会持续运行很长时间,而ELSE
部分根本不会执行。
测试等待的时间是否有问题或者是否有其他问题?
I am designing an automation framework for a web based application. I have used 'Exist' method to check if the user has correctly logged into the application. Something like this:
If Browser("XXX").Page("YYY").WebElement("Either you have entered").Exist(0)
Then
Browser("XXX").Page("YYY").Image("btnok").Click
fnReset = false
Else
If Browser("XXX").Page("YYY").WebElement("Account Search").Exist(0) Then
fnReset = true
End If
Browser("XXX").Page("YYY").Sync
End If
This code works fine , if an invalid username/password is entered as it hits the IF
part first.
However, when I try with a valid username/password, the IF
condition step keeps running for a long time and the ELSE
part is not getting executed at all.
Is there an issue with the timing for which the test waits or is there any other problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
难道即使登录成功,
“您已输入”
仍然存在,但用户看不到?也许它有hidden=true
。尝试手动成功登录,然后从对象存储库中突出显示该WebElement
。如果它没有抱怨该对象不存在,则您用于检测成功登录的条件不正确。Could it be that the
"Either you have entered"
exists even when the login succeeds but isn't visible to the user? Perhaps it hashidden=true
. Try to login successfully manually and then highlight thatWebElement
from the Object Repository. If it doesn't complain that the object does not exist the condition you're using for detecting successful login isn't correct.