It only doesn't work when i use datatable when i use print function it 
works fine. Can some one help me please




wait 2
'DataTable.GetRowCount    
i=0

Set mypage=browser("title:=.*").page("title:=.*")


While mypage.image("class:=mm","index:="&i).exist
mypage.Sync
wait 3
 Datatable( "VehicleName", dtGlobalSheet )= 
 mypage.image("class:=mm","index:="&i).getroproperty("filename")
 Datatable( "VehicleName", dtGlobalSheet )= 
mypage.image("class:=mm","index:="&i).getroproperty("href")
 Datatable( "MSRP_Price", dtGlobalSheet )= 
mypage.WebElement("class:=tx2","index:="&i).getroproperty("innertext")

   mypage.image("class:=mm","index:="&i).click
                mypage.Sync
                wait 4

i=i+1

Set desc2=description.Create
  desc2("micclass").value="WebElement"
  desc2("class").value="tx2"
  Set obj2=browser("title:=.*").page("title:=.*").ChildObjects(desc2)
     Datatable( "MSRP", dtGlobalSheet )= obj2(0).getroproperty("innertext")
Datatable.SetCurrentRow(i)


wait 6

Browser("creationtime:=0").Back



Wend



On Tuesday, June 25, 2013 9:08:04 PM UTC-4, [email protected] wrote:
>
> hi , 
>  it is still doing same thing. issue is still present 
>
> On Tuesday, June 25, 2013 12:28:39 AM UTC-4, Chethu wrote:
>>
>> keep this code out of while loop then it should work 
>>  
>> 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
>>
>> Its looping problem just cross check twice.
>>  
>>
>> ~Chets
>>
>>
>> On Tue, Jun 25, 2013 at 6:17 AM, <[email protected]> wrote:
>>
>>> 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.
>>>  
>>>  
>>>
>>
>>

-- 
-- 
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.


Reply via email to