SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Click in QTP

  1. #1
    Senior Member
    Join Date
    Sep 2004
    Location
    Ashland, ma, USA
    Posts
    275
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Click in QTP

    If I set focus on some link, can I code clicking on this link without recording object for this link.

    Actually the whole task is to set focus on some text box,
    make (say 9) TABs and click on the link.
    The name of this link is different on different pages, but the number of TABs is the same to reach this link. So I
    would like to code TABs and universal click without recording link names as objects, as there will be thousands of them.

    In Rational Robot or WinRunner it is a piece of cake.

    Could you help me.

    Thanks,
    Vitaly

  2. #2
    Moderator
    Join Date
    Oct 2005
    Location
    UK
    Posts
    407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    You could try using a regular expression or the link index.
    Ron
    *******
    If you had to identify, in one word, the reason
    why the human race has not achieved, and never
    will achieve, its full potential that word would be "meetings".

  3. #3
    Senior Member
    Join Date
    Sep 2004
    Location
    Ashland, ma, USA
    Posts
    275
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    I do not understand how I can use regular expressions
    to code a click. Could you give me more detailes.
    Could you also tell me what is and how to use Link Index.

    Thank you very much,
    Vitaly

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    If you can set focus on the link then you can click it using the below code

    Browser().object.document.activeElement.click

  5. #5
    Senior Member
    Join Date
    Sep 2004
    Location
    Ashland, ma, USA
    Posts
    275
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    How to set focus on the link? You mean by TABing
    or there is some other way?

  6. #6
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    I think you said you have the focus and need to click...i would say you can do the tabbing...

  7. #7
    Senior Member
    Join Date
    Sep 2004
    Location
    Ashland, ma, USA
    Posts
    275
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    Could you give me an example how to use SendKey.
    Thanks,
    Vitaly

  8. #8
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    try this

    set WshShell = CreateObject("WScript.Shell")
    WScript.Sleep 100
    Browser().Activate
    WScript.Sleep 100
    WshShell.SendKeys "{TAB}"
    set WshShell=Nothing

  9. #9
    Senior Member
    Join Date
    Sep 2004
    Location
    Ashland, ma, USA
    Posts
    275
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    I managed to make TABs working from the required place.

    But I need to click on the link which will have different
    names. I therefore cannot store it's name in OR.

    I tried
    Browser(SomePage).object.document.activeElement.cl ick
    but it gives an error.

    Could you help me with coding click when I am at some
    place on the page.

    Vitaly

  10. #10
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Click in QTP

    Save the web page as MHT and attach it to the post...

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:11 PM.

Copyright BetaSoft Inc.