Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

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

This is a discussion on How to capture first link in webpage when content changes everytime?? within the QTP forums, part of the Software Testing category; 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 ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 01-20-2007
Junior Member
 
Join Date: Jan 2007
Location: Knoxville, TN
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
yogesh_v81 is on a distinguished road
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 08:21 AM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-02-2007
Junior Member
 
Join Date: Jan 2007
Location: kolkata
Posts: 12
Thanks: 0
Thanked 2 Times in 2 Posts
amarreddy79 is on a distinguished road
Re: How to capture first link in webpage when content changes everytime??

How about using regular expressions?
Reply With Quote
  #3 (permalink)  
Old 02-22-2007
Contributing Member
 
Join Date: Feb 2007
Location: Delhi
Posts: 51
Thanks: 3
Thanked 12 Times in 6 Posts
smganesh is on a distinguished road
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
Reply With Quote
  #4 (permalink)  
Old 02-27-2007
Junior Member
 
Join Date: Feb 2007
Location: usa
Posts: 12
Thanks: 0
Thanked 3 Times in 3 Posts
Sudhan_Otsuka is on a distinguished road
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
Reply With Quote
  #5 (permalink)  
Old 02-28-2007
Contributing Member
 
Join Date: Feb 2007
Location: Delhi
Posts: 51
Thanks: 3
Thanked 12 Times in 6 Posts
smganesh is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Content of an obj file in C JobHelper C and C++ 3 08-23-2007 06:25 AM
Capture the screen shot of the application JobHelper WinRunner 3 04-19-2007 07:10 AM
How to capture the contents of HTML table in robot Ashish Kadam Rational Robot 2 01-19-2007 01:27 AM
Webpage / Frame Checkpoint Lokesh M QTP 4 12-11-2006 02:00 PM
Content Assist Lokesh M HTML & CSS 0 06-26-2006 08:37 AM


All times are GMT -4. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved