Contributions
Re: Window is not recognized because x.ChildCount wrong
The Object Browser always reports 6 children on Sys.Process("NAME").Form("License Wizard") in the property display. The object browser will display the 6 children only after many refreshes. Using refresh in script, I get 6 rarely, but only after many refreshes. TC cannot click on the required object because is is not always available even though it's clickable on the screen. -Pv-963Views0likes0CommentsRe: Window is not recognized because x.ChildCount wrong
TC Enterprise 8.2 on Win7x64. ChildCount is not always successful for me even after refresh on QWidget controls: Object Browser: Sys.Process("NAME").Form("License Wizard"): ChildCount = 6 Children displayed: Window("QWidget", "", 1) Window("QWidget", "", 2) MenuBar("System") TitleBar(0) Client("LicenceWizard") Client(0) In script Sys.Process("NAME").Form("License Wizard").Refresh(); Log.Message("Searching " + Sys.Process("NAME").Form("License Wizard").ChildCount + " children..."); for (var i = 0; i < Sys.Process("NAME").Form("License Wizard").ChildCount; i++) { var MyItem = Sys.Process("NAME").Form("License Wizard").Child(i); Log.Message("Searching Item: '" + MyItem.Name + "'"); } Result: Searching 4 children... Searching Item: 'Client(0)' Searching Item: 'Client("License Wizard")' Searching Item: 'TitleBar(0)' Searching Item: 'MenuBar("System")' The control I want to click is in "Window("QWidget", "", 2)" Note: the index may change to protect the innocent... If I run this code multiple times, there is a random chance the window with the control I want will show up as one of the 4 detected children. Very occasionally, 6 children will be reported and the control will be found. -Pv-961Views0likes0CommentsRe: Does TestComplete support DevExpress Lookupedit control?
The demo.exe programs used by the devexpress grid samples included with my TestComplete 8.10 installation (Documents and Settings\All Users\Shared Documents\Test Complete 8 Samples\Working with Grids\...) does not exists anywhere on my hard drive. How do I obtain the demo programs so the demo scripts will run? WinXp Pro. The Tested Application path currently coded into the script does not exist. There is no "DevExpress 2010.1 Demos" directory anywhere on my hard drive. Does some devexpress distribution have to be installed for these samples to work? -Pv-3.5KViews0likes0CommentsRe: Searching for text
I cannot use mapping because I need cross-browser code and the pages are too dynamic to map reliably. I've also learned timing is a critical issue in the search for ExtJS items in the object tree. There appears to be two problems: 1) The page has to completely redrawn after a page request caused by a screen button click. 2) After the page is drawn, I cannot serach the object tree successfully until the object tree has been refreshed manually. The "simple" pages I'm testing right now have between 400 and 800 items per page while there are only 5 to 10 controls on the page. Although this isn't the best place to put the delays and refresh, this way I don't have to think about whether I need to do it or not and just accept the 2 seconds overhead per search. Example: MyItem = Item_LocateInPage(BrowserProcess, "innerHTML", "Cancel"); if(MyItem != null) {MyItem.Click();} function Item_LocateInPage(TREE_MODEL_OBJECT, PropertyType ,SearchText) { Log.Message("Item_LocateInPage: " + PropertyType + " " + "\'" + SearchText + "\'") var obj = null; Delay(1500); // Wait for page to draw TREE_MODEL_OBJECT.Refresh(); Delay(500); // Wait for object model to refresh if(!TREE_MODEL_OBJECT.ChildCount || TREE_MODEL_OBJECT.ChildCount == undefined) {Log.Warning("No " + TREE_MODEL_OBJECT + " Children Detected in search"); return null} Log.Message("Searching " + TREE_MODEL_OBJECT.ChildCount + " children..."); if(PropertyType == "idStr") var obj = TREE_MODEL_OBJECT.FindChild("idStr", SearchText, 100); if(PropertyType == "outerText") var obj = TREE_MODEL_OBJECT.FindChild("outerText", SearchText, 100); if(PropertyType == "Name") var obj = TREE_MODEL_OBJECT.FindChild("Name", SearchText, 100); if(PropertyType == "NodeName") var obj = TREE_MODEL_OBJECT.FindChild("NodeName", SearchText, 100); if(PropertyType == "value") var obj = TREE_MODEL_OBJECT.FindChild("value", SearchText, 100); if(PropertyType == "textContent") var obj = TREE_MODEL_OBJECT.FindChild("textContent", SearchText, 100); if(PropertyType == "innerHTML") var obj = TREE_MODEL_OBJECT.FindChild("innerHTML", SearchText, 100); if ((obj == null) || (false == obj.Exists)) { Log.Warning("Not Found."); return null; } else return obj; } -Pv-1.3KViews0likes0Comments- 1.3KViews0likes0Comments
Re: Searching for text
Thanks again for your help. I could not use "id" because in ExtJS generated ID properties are dynamic and more often than not, non-repeatable. In our current app, many of the page items I need to locate have varying properties which have some kind of uniqueness, so I need to be flexible about which property I use to find something, but I can almost never rely on IDs. When I need to generate, then click on list items generated in real time, the IDs ALWAYS change so cannot map them. I hope to let you know soon if this worked. -Pv-1.3KViews0likes0CommentsRe: Searching for text
Thank you for responding. From my understanding, the IF statement in question should not be affecting the portion of the script containing the FindChild: if(TREE_MODEL_OBJECT.ChildCount < 1) {Log.Message("No Children Detected in search"); return null} Log.Message("Searching " + TREE_MODEL_OBJECT.ChildCount + " children..."); var obj = TREE_MODEL_OBJECT.FindChild("NativeWebObject.outerText", SearchText, 100); if (false == obj.Exists) { Log.Error(SearchText + " not found."); return null; } else return obj; ============================= Results: Item_LocateInPage Searching 764 children... sdfg not found. Since my script is returning the number of children found and not "No Children..." I think the FindChild is executing but returning nothing unaffected by the <1. Appreciate your help. -Pv-1.3KViews0likes0Comments