Micro Focus QTP (UFT) Forums
SAPLIst within a table is not working - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: SAPLIst within a table is not working (/Thread-SAPLIst-within-a-table-is-not-working)



SAPLIst within a table is not working - lakshjai - 12-17-2010

Hi Ankur/All,

I am not able to select an item listed inside a SAPList within a webtable . The application is developed using webdynpro.
I tried the following methods
1.
Code:
Browser(..).Page(..).SAPList(...).click
Browser(..).Page(..).webelement("innertext:=Test").click.

The first line is working fine.i.e., its clicking the SAP list , but the second line is not working ..its throwing an error message. I have attached the screenshot of the error message and also the application.
I tried with different properties of the webelement like outer text, outerhtml, innerhtml, but nothing worked. Even when I spy on the SAPlist object, in the allitems properties of the webelement there is no items listed there.

The second method I tried is :
2.
Code:
Browser(..).Page(..).SAPList(..).object.setattribute "value","Test"
it sets the value in the list box , but when i Save that page, its resetting it back. the value is not saved.

For other list box in the application i.e List box which is not in the webtable i used the innertext property of the webelement and it worked fine.

I am not sure how to get this SAPList inside the webtable to work.
I would really appreciate if someone can help me in this.

Thanks
Laksh


RE: SAPLIst within a table is not working - shailendra.pathak - 02-18-2011

Hi Laksh,

While automating the SRM shopping cart functionality I also faced similar kind of issue while identifying a product type from the drop down. In the recording QTP has identified the object as SAPList but it was failing while execution.

When I used the object spy the drop down was made up of a web edit and the drop down options were as web elements which were embaded into a web table which was the part of the frame in which the SAP list object was there.

To solve this I used descriptive programming, in which I have used the childObjects method to get the child object and then selecting a particular option. The snippet for the code is as follows,

Code:
' Creating a description object for web table identification
Dim objTable
Set objTable=Description.Create
objTable("name").value="WebTable"
objTable("innertext").value="MaterialService"

set childObjectFrame=Browser("Shop - SAP NetWeaver Portal").Page("Shop - SAP NetWeaver Portal").Frame("Frame").ChildObjects(objTable)

'msgbox childObjectFrame.count

'Creating a description for material web element

Dim objMaterialElement
Set objMaterialElement=Description.Create
objMaterialElement("micClass").value="WebElement"
objMaterialElement("innertext").value="Material"

objMaterialElement.click

Hope this might help you to resolve the issue. This is working fine for me.

-Shailendra