SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Jul 2007
    Posts
    229
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to click on a Link

    Hi,

    I am having a scenario , in which I am suppose to click on a link.

    The condition are as follows:-

    1). The name of the link is "profile TSTAS21_User_Profile" , where "TSTAST21" is a user name.

    2). The Link Object be recognized with the "Html Tag" and the link text "text".

    Now for each new build the name of the link i.e. "text" be going to changed. even I can't make it as a regular expression like "profile.*" as it will give the ambiguity with the other link object.

    now ,anyone can please suggest me that how can we make the script to be too robust so for the each new build it will click on that link.

    Thanks,
    Sunil.

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click on a Link

    From your description is there any reason you can't use the following regEx:

    "profile .*_User_Profile"

    These are always tough to suggest when we can't see the other like objects on your page.

  3. #3
    Senior Member
    Join Date
    Jul 2007
    Posts
    229
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click on a Link

    Yes, Because the text is a varying.So it is not sure that on next build the text string be the same.

    Thanks,
    Sunil.

  4. #4
    Senior Member
    Join Date
    Jul 2007
    Posts
    229
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click on a Link

    In other words, I can put my queries as for the suggestion that ,

    "How can we pick the Text during the Run time and then click for the same".

    Please suggest.
    Sunil.

  5. #5
    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: How to click on a Link

    If you don't know what can change then i doubt that any r.e. would help you. There has to be a pattern if you want to use r.e.

  6. #6
    Member
    Join Date
    Jul 2003
    Location
    Boston
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to click on a Link

    ************************************************** ****************************************
    Public Function Click_on_Link(PageObj,setToFind,status)

    Set var_ChildObjects = PageObj.object.links ' this will have a handle of all "Link"objects in the page
    num=var_ChildObjects.length ' gives you the number of objects that are "Link"
    status="False"
    For j=0 to num-1
    inText=trim( var_ChildObjects(j).innertext)
    If inText=setToFind then
    var_ChildObjects(j).click
    Reporter.ReportEvent 0,"Link Clicked", " '"&check_text&"' was clicked"
    status="True"
    Exit For
    End if
    Next

    End Function

    ************************************************** ****************************************

    where input parameters

    PageObj=Browser("Browser1").Page("Page1") ' the page where the link is located, you would have to set this before you run the function
    setToFind="profile"&USERNAME_var ' you would have to obtain the username from the application and store it in USERNAME_var

    status is the parameter that you return ' status is True when you click the object
    Adai

 

 

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 7.69%
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 06:04 AM.

Copyright BetaSoft Inc.