Hi there i am trying to capture all the value when i run this script But when run it the value it captures and insert into the data table. But it captures the values of second vehicle it overwriites the values of 1st vehicle. When i use print function it works fine. but only with data table it does that
Dim bro, url, image bro = "iexplore" url = "http://www.chevrolet.com/tools/help-choose-vehicles.html" systemutil.Run bro, url browser("title:=.*").Sync wait 15 DataTable.GetRowCount i=0 Set mypage=browser("title:=.*").page("title:=.*") While mypage.image("class:=mm size_3","index:="&i).exist mypage.Sync wait 3 Datatable( "VehicleName", dtGlobalSheet )= mypage.image("class:=mm size_3","index:="&i).getroproperty("filename") Datatable( "VehicleName", dtGlobalSheet )= mypage.image("class:=mm size_3","index:="&i).getroproperty("href") Datatable( "HelpMeChooseMSRP", dtGlobalSheet )= mypage.WebElement("class:=tx_price","index:="&i).getroproperty("innertext") mypage.image("class:=mm size_3","index:="&i).click mypage.Sync wait 4 i=i+1 Set desc2=description.Create desc2("micclass").value="WebElement" desc2("class").value="parbase ts_attr_c1 section" Set obj2=browser("title:=.*").page("title:=.*").ChildObjects(desc2) Datatable( "MSRPonMOPAGE", dtGlobalSheet )=obj2(0).getroproperty("innertext") Datatable.SetCurrentRow(i) Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.DisplayAlerts = False Datatable.Export("C:\Users\Wajahat.awan\Desktop\Automation\Private DHC\Chevy DHC\Default.xls") Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Wajahat.awan\Desktop\Automation\Private DHC\Chevy DHC\Default.xls") objWorkbook.SaveAs ("C:\Users\Wajahat.awan\Desktop\Automation\Private DHC\Chevy DHC\MRSP Verify code" & Day(Date) & Month(Date) & Year(Date) & ".xls") objExcel.Quit wait 6 browser("title:=.*").Back Wend -- -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en --- You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
