clicking on particular link using qtp function

做~自己de王妃 提交于 2019-12-02 13:25:27

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

You can choose two approaches from here. 1. Object Repository: Press Ctrl + R to Open object repository. Then add objects to your repository. Once you add them, Just Drag and drop.

  1. Descriptive Programming: Just Like answer one
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!