这里是要获取用户名和密码的函数:
Function SetWebEdit(TempObj,Value)
Err.Clear
On Error Resume Next
If Value="" Then Exit Function
TempObj.Set Value
If Err.Number<>0 Then
strName=Split(Err.Description,Chr(34))
If UBound(strName)=0 Then
strMsg=strName(0)
Else
StrMsg=strName(1)
End If
strDesc=Err.Description
&#39; On Error Goto 0&#39; ExitTestIteration将不起作用,将恢复错误对象
报告ATSNo&amp;&#34; - &#34;&amp; TestCaseName&amp;&#34; -SetWebEdit - 运行错误 - &#34;&amp; TempObj.GetTOProperty(&#34; html id&#34;)&amp;&#34; - &#34; &amp; strDesc,&#34;失败&#34;,&#34;是&#34;,obj_homepage
结束如果
结束功能
我要调用以下函数来验证登录过程:
Function Authenticate()
'Set the username and password and click on Sign in
Set Global_Authentication=obj_homepage.WebElement("objectid")
'Global_Authentication.highlight
if Global_Authentication.Exist(10) then
Call SetWebEdit(Username,"name")
Encryped_Pwd="12345"
Password.SetSecure Encryped_Pwd
wait(2)
Call ClickWebButton(Signin)
wait(5)
End if
End Function
除下一个特定时间外,它的工作正常:
Function Check_Out()
'Set Resolve_click = obj_homepage.WebElement("objectid")
Set Resolve_click = obj_homepage.WebElement("objectid")
IF Resolve_click.Exist(10) then
Call ClickWebElement(Resolve_click)
End IF
wait(5)
Set Authorize_button = obj_homepage.WebButton("objectid")
If Authorize_button.Exist(10) Then
Call ClickWebButton(Authorize_button)
End if
wait(10)
Call Authenticate()
wait(15)
Set Paper_Form_Signed = obj_homepage.WebButton("objectid")
If Paper_Form_Signed.Exist(10) Then
Call ClickWebButton(Paper_Form_Signed)
End if
wait(8)
End Function
单击“授权”按钮,但不输入用户名和密码。请让我知道这个问题和可能的解决方案。
谢谢!