06-01-2009, 10:36 PM
I have Browser("B").Page("P").Frame("body").Link("x").Click more that 10 on one page. I want to use for loop to click each links using the index or other method in QTP. Please help
click each web link in a page using Index or other method in QTP
|
06-01-2009, 10:36 PM
I have Browser("B").Page("P").Frame("body").Link("x").Click more that 10 on one page. I want to use for loop to click each links using the index or other method in QTP. Please help
06-03-2009, 02:10 AM
first use Child Objects to get the count of number of links a page.
And then use this count in the "for loop" to click on each of the links.
06-16-2009, 12:57 PM
Code: Set oLinks = Description.Create
07-03-2009, 06:12 PM
Modification :
objLinks(cint(i)).click - There is no requirment for Cint because we are dealing with HTML dom & there is no polymorphisim involved in this.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
07-10-2009, 12:39 PM
Hi,
I need to click each and every link on a web page. i tried the above mentioned option. since my web page is having many frames, it will select the links which we will specify in code. How can i select all the frames in a web page and each time it should take the links in each frame and click it. after one frame over it should point to next frame and select all the links from that page. Anybody could you please help me.
07-10-2009, 03:13 PM
Hi
Try this code Code: Set oFrame = Description.Create()
07-10-2009, 04:35 PM
yup the above code will work's out. But, i think we have to come back to the same page after clicking on the link (if we are navigating to other page when clicked on link) under such conditions we have to use "Browser("B").Back" once we successfully clicked and navigated to other page.
Thanks, QTPKing
07-11-2009, 12:19 PM
Hi all,
Thanks for the quick response. Its working fine.
07-11-2009, 05:02 PM
hi ,
In above program after each link clicked, as a effect of click on the links some time new web window will open and some time the Content of main page will change. i need to check after clicking a link no error should be displayed in the web page i used the below program to find whether any error occured in the web page. I called a program which will return false if any error occured in the page. then in main progrma i can write lik if error occured then just click on log off button so that it should lead to same page as it was before the occurance of error. Here control is not going inside the statement-- If IsPageCannotBeDisplayed(oBrw,PCD_Keywords) Then And also i am passing the argument oBrw as same all the time, how can i pass the web page name which is currently opened (it may be new Web page window or the same page where the data chanaged) Below is the program where i changed Bold letters are same as you mentioned in the above program For k = 0 to LinkCount-1 objLinks(k).Click Code: Set oBrw = Browser("A").Page("B") Next ' Function which i am calling Code: Public Function IsPageCannotBeDisplayed (oBrw,PCD_Keywords)
07-13-2009, 05:28 PM
hi all,
in above post wat i meant to convey is-- After i click a link, new page is opening(in same window or new pop up window), i need to check that content of page should not be "Page cannot be displayed" or some "error message". to achive this requirement i called the program which i have mentioned in the previous post. but it is not working properly, Could you please guide me where i am going wrong. and also for this function i need to pass the web page name which is recently opened as a effect of click on the link. |
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Webtable contains cell contains two links, how to click on link | srinivassure | 9 | 53,669 |
07-30-2016, 03:41 PM Last Post: Akshay |
|
VB Script to count number of links in a web page. | Suma Parimal | 4 | 25,377 |
07-01-2015, 12:59 PM Last Post: govind |
|
Upgraded QTP 11.0 to UFT 11.53, Object Index Properties are varying | Raghava M | 0 | 2,192 |
01-28-2015, 06:02 PM Last Post: Raghava M |
|
General run error. Line (18): "Loop while Browser("Index:=0").Object.Busy" | AshokReddy | 3 | 5,117 |
12-20-2013, 01:44 PM Last Post: sshukla12 |
|
Unable to select a combo item by value or index | martinshort | 2 | 3,615 |
08-26-2013, 07:55 PM Last Post: sudhirzpatil |