|
|
|
|
How to get all links in a page
|
|
08-26-2010, 12:05 PM
(This post was last modified: 09-07-2010 10:24 AM by iamsekhar.)
Post: #1
|
|||
|
|||
|
How to get all links in a page
Scenario: In my application there are many links, by clicking each and every link the 1. Click the hyperlinks 2. Then "File Download" dialouge appears we have to save file name in any drive (C or D) 2. After saving file then get row count in xls file. Note: I have done above scenario by recording and writing script, it was working without any issues. Refer below code FYI I have many kind of scenarios to validate xls row count. Is there any other way to write code optimization like function or Descriptive programming? Kindly suggest your approach. Please refer below code FYI Window("Lilly Science Grid").Page("Page_3").Link("25").Click // clicking link wait(2) rowCnt = Window("Lilly Science Grid").Page("Page_3").Link("25").GetROProperty("text") convLng = CLng(rowCnt) msgbox rowCnt wait(3) SwfWindow("Lilly Science Grid").Dialog("File Download").Click 285,18 // QTP generated script SwfWindow("Lilly Science Grid").Dialog("File Download").Activate // QTPgenerated script SwfWindow("Lilly Science Grid").Dialog("File Download").WinButton("Save").Click // wait(5) Dialog("Save As").Activate Dialog("Save As").WinEdit("File name:").Set "D:\tumo.xls" Dialog("Save As").WinButton("Save").Click Dialog("Save As_2").WinButton("Yes").Click Dialog("Download complete").Click 321,184 Dialog("Download complete").WinButton("Close").Click fileName = "D:\tumo.xls" Set xlObj = CreateObject ("Excel.Application") Set wBook = xlObj.workBooks.Open(fileName) Set sheetName = wBook.worksheets("Sheet1") 'Set sheet = xlObj.ActiveWorkbook.worksheets("sheet1") column_count = sheetName.usedrange.columns.count row_count = sheetName.usedrange.rows.count xlsRowCnt = row_count -1 msgbox xlsRowCnt If xlsRowCnt = convLng Then reporter.ReportEvent micPass, "Row Count Validation","Row Count matching with column header. Step.Pass" else reporter.ReportEvent micFail, "Row Count Validation","Row Count is not matching with column header.Step.Fail" End If wBook.close Thanks for your help. Sekhar Chandra Sekhar Sr. Test Engineer Singapore |
|||
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads... | |||||
| Thread: | Author | Replies: | Views: | Last Post | |
| Unable to get total number of links on a web page | RGummadidala | 4 | 1,247 |
02-17-2011 06:47 AM Last Post: RGummadidala |
|
| How to capture the links in web page | estherindu | 1 | 539 |
12-12-2009 10:34 PM Last Post: upadhyay40 |
|
User(s) browsing this thread: 1 Guest(s)
|
|

Search
Member List
Calendar
Help



