clicking on particular link using qtp function

前端 未结 2 634
轮回少年
轮回少年 2021-01-27 12:16

I want to automate login process to flipkart by creating a function which is being called in an action

Function Website() \'this is the function
Systemutil.Run(         


        
2条回答
  •  遇见更好的自我
    2021-01-27 12:48

    If you want to do it with descriptive programming, this would be a simple example: (I used the direct login-page, because it is easier than clicking on that login link)

    Website()
    
    Function Website()
        Systemutil.Run("iexplore.exe"), "https://www.flipkart.com/account/login?from=header"
        set objPage = Browser("title:=Flipkart.com: Login.*").Page("title:=Flipkart.com: Login.*")
    
        objPage.Sync()
    
        objPage.WebEdit("html id:=login_email_id1").Set "UsernameXY"
        objPage.WebEdit("html id:=login_password1").Set "SecretPassword"
        objPage.WebButton("html id:=login-cta").Click()
    
    End Function
    

提交回复
热议问题