![]() |
click each web link in a page using Index or other method in QTP - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: click each web link in a page using Index or other method in QTP (/Thread-click-each-web-link-in-a-page-using-Index-or-other-method-in-QTP) Pages:
1
2
|
click each web link in a page using Index or other method in QTP - smeijer - 06-01-2009 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 RE: click each web link in a page using Index or other method in QTP - niranjan - 06-03-2009 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. RE: click each web link in a page using Index or other method in QTP - ursvinod - 06-16-2009 Code: Set oLinks = Description.Create RE: click each web link in a page using Index or other method in QTP - basanth27 - 07-03-2009 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. RE: click each web link in a page using Index or other method in QTP - mss - 07-10-2009 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. RE: click each web link in a page using Index or other method in QTP - KVK - 07-10-2009 Hi Try this code Code: Set oFrame = Description.Create() RE: click each web link in a page using Index or other method in QTP - supputuri - 07-10-2009 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 RE: click each web link in a page using Index or other method in QTP - mss - 07-11-2009 Hi all, Thanks for the quick response. Its working fine. ![]() ![]() ![]() ![]() ![]() RE: click each web link in a page using Index or other method in QTP - mss - 07-11-2009 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) RE: click each web link in a page using Index or other method in QTP - mss - 07-13-2009 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. |