Results 1 to 5 of 5

Thread: How to capture first link in webpage when content changes everytime??

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Answers
    1
    am involved in webbased testing. I need to capture the very first link in website and in my case contents change everytime i refresh the site. So does that mean i need to record so many times or is there an alternative method. Also this link will be used to retrieve a value in later part of app. How to handle this?

    Folks,

    After much stress i got the answer too. When you are recording a webpage you will be able to see the active snapshots of a page in Active screen of QTP.

    Go to active screen right click on the link and select "Insert output value". A small window(object selection) will pop-up with the link being highlighted. Click on its parent property say Webtable. Click

    Table output properties window will be displayed. Select the corresponding text of the link and output the same to datatable.
    Also since link changes everytime do export the datatable(runtime) to excel sheet using

    DataTable.Export("filepath"). Later on you can use the excel sheet in the script again by DataTable.Import function.

    Last edited by jainbrijesh; 09-18-2007 at 07:21 AM.

  2. #2
    Junior Member
    Join Date
    Jan 2007
    Answers
    12

    Re: How to capture first link in webpage when content changes everytime??

    How about using regular expressions?


  3. #3
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    Re: How to capture first link in webpage when content changes everytime??

    you can use the below script to click the first link in a page:

    Browser().Page().link("ClassName:=Link", "Index:=0").click


  4. #4
    Junior Member
    Join Date
    Feb 2007
    Answers
    12

    Re: How to capture first link in webpage when content changes everytime??

    You need to create Description object for the links on web page then using For loop count the no.of links on the page then retrive first link content.

    Mahi


  5. #5
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    Re: How to capture first link in webpage when content changes everytime??

    I think, there is no need to create a description object. This would be sufficient.

    Browser().Page().link("ClassName:=Link", "Index:=0").click


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact