I get this error on running the script:
general run error:
also, what i am trying to achieve is launch url-->copy paste data from that page--> into excel--> quit browser-->launch browser again and enter new url.
for every url http://emops.tse.com.tw/server-java/t05s...&year=2004, co_id(2463 in this case) is a variable which will be different everytime i launch a browser.
also, my settings in qtp are run test on any browser window and on any windows application.
is this correct? try running this code on your machine.
for getting the url, put this in 3 or 4 rows in column A of action1 sheet:
http://emops.tse.com.tw/server-java/t05s...show&co_id=
Coumn B:
3006
2498
2463
Column C:
&year=2004
&year=2004
&year=2004
in test settings from File, i have "run on all rows" in the Run tab. i am trying to provide all info for you to narrow down the cause of error. Hope this helps. thank you for chasing this.
general run error:
Code:
Set WebEdits=Browser("Title:=Financial Analysis").Page("Title:=Financial Analysis").ChildObjects(desc)
also, what i am trying to achieve is launch url-->copy paste data from that page--> into excel--> quit browser-->launch browser again and enter new url.
for every url http://emops.tse.com.tw/server-java/t05s...&year=2004, co_id(2463 in this case) is a variable which will be different everytime i launch a browser.
also, my settings in qtp are run test on any browser window and on any windows application.
Code:
For i=0 to 1991
SystemUtil.Run "C:\Program Files\Mozilla Firefox\firefox.exe","","c:\documents and settings\Harp ","open"
Dim url1, url2, url3, url
url1= datatable.Value("A", dtlocalsheet)
url2=datatable.Value("B",dtLocalsheet)
url3= datatable.value("C",dtlocalsheet)
url= url1&url2&url3
Window("Mozilla Firefox").WinObject("MozillaWindowClass").Type url
Window("Mozilla Firefox").WinObject("MozillaWindowClass").Type micReturn
wait(4)
Set desc=Description.Create()
desc("micclass").value="WebTable"
desc("text").Value="200220032004Capital structure analysis.*"
Set WebEdits=Browser("Title:=Financial Analysis").Page("Title:=Financial Analysis").ChildObjects(desc)
cCount=WebEdits(0).getROProperty("cols")
rCount=WebEdits(0).getROProperty("rows")
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook= objExcel.Workbooks.Open("C:\Documents and Settings\Harp\Desktop\ForumExcel.xls")
Set objSheet=objExcel.Sheets("Sheet1")
For m=1 To rCount
For n=1 To cCount
data=WebEdits(0).GetCellData(m,n)
If (Instr(data,"analysis (%)") <> 0 OR Instr(data,"flow (%)") <> 0)Then
objsheet.Cells(m,n).Value=data
n=cCount
else
objsheet.Cells(m,n).Value=data
End If
Next
Next
objWorkbook.save
objWorkbook.close
objExcel.Quit
set objExcel=nothing
window("mozilla firefox").Close
wait(5)
next
is this correct? try running this code on your machine.
for getting the url, put this in 3 or 4 rows in column A of action1 sheet:
http://emops.tse.com.tw/server-java/t05s...show&co_id=
Coumn B:
3006
2498
2463
Column C:
&year=2004
&year=2004
&year=2004
in test settings from File, i have "run on all rows" in the Run tab. i am trying to provide all info for you to narrow down the cause of error. Hope this helps. thank you for chasing this.