How to handle dynamic powerbuilder DataWindow?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to handle dynamic powerbuilder DataWindow?
Hi,
I am working on a powerbuilder application having dynamic pbdw control. The rows are loaded based on some filter criteria. I am not able to identify objects in the application. However if i try to spy application which has pre loaded data, i can identify them correctly.
for e.g. in the below code. The objExpectationIds doesnt return anything . But if application is preloaded with data before execution it works. Please help
PropNames=Array("Caption","ObjectType")
PropValue=Array("expectation_id","Edit")
objExpectationIds=expectationPanel.FindAllChildren(PropNames,PropValue,5)
Log.Message("")
For i=0 to UBound(objExpectationIds)
if(objExpectationIds(i).Value="82286") then
objExpectationIds(i).Click
Exit For
end if
Next
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Arorasaksham,
Try using the Refresh method to update the object tree before accessing its content.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tanya,
Thanks for response, but refresh doesn't work. Since the datawindow is dynamic and the object browser is not getting refreshed. The object browser is getting freezed for first available instance of data window. Even the spy is not working.
I have tried refreshing already (both by code as well as through object browser). I think this issue is specific to Powerbuilder and testcomplete only.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having the same.
Its TC bug i guees.
What i did is:
num = panel.ChildCount x=0 rows_number=0 while (x<num): if(panel.child(x).Caption=="zn" and panel.child(x).Visible == 1): rows_number=rows_number+1 x=x+1 Log.Message("rows_number: ") Log.Message(rows_number)
Problem is that u can only tests filter that give back less rows than i can see on my screen cause the rest gonna have visible=0.
Looks like TC cant delete child on refresh - he only refresh properties - so only way is couting on properties.
