Contributions
- 1.4KViews1like0Comments
Re: Issues With Mapping in Web Apps
A few things I've learned while working with ExtJS apps: 1) Reparenting items and enabling the Extended Find is a very useful approach, but must be used carefully, and even if you do it perfectly it still may not work as well as you'd like. Take care to choose an appropriate parent object, and be sure that you can find that object reliably. 2) Be careful with the "className" property. ExtJS uses this property for all sorts of things, and it changes frequently on some objects. So be sure to thoroughly wildcard this property whenever you use it, and be aware that the value you see in the object browser will often have leading or trailing spaces that you can't see. 3) ExtJS provides a "Name" property on most of the control classes, which is usually not used by developers, but if it is used will go into the ObjectIdentifier field in TC. If you can convince the developers to provide useful names on the important controls, then it makes finding them much, much easier than it is when you're stuck with names like "ext_gen123". 4)Using the various Find methods is often more reliable than name mapping for these controls. That last one is probably the most significant lesson I've learned. I generally use name mapping to find an ancestor of the object I want, then use FindChild or FindAllChildren to locate the object itself.1KViews0likes0CommentsRe: Increment a variable by 1?
I don't use VB at all, so these things may not be issues, but I notice two things that look wrong to me. First, you use set to increment the counter, but not for the initial assignment to 0. Second, you do not dim the obj variable. As a matter of style though, "For" loops are usually preferred in cases where you need a counter. Opinions certainly differ, but something like this would generally be considered better: For i = 1 to 10 aqUtils.Delay 100 set obj = browser.NativeWebObject.Find("class", "confirmboxcont") If obj.Exists Then Exit For Next2.6KViews0likes0CommentsRe: Email a folder instead of individual files using script.
The SendMail function can only send a single attachment. The SendEmail (note different spelling) function listed at the URL you provided is able to send multiple attachments, but their names must be provided as a comma-separated list. You can generate a list of files in a folder using something like this (apologies if the syntax is wrong. I don't normally use VB) : Function ListFiles(folder) Dim oFolder, colFiles, f Set oFolder = aqFileSystem.GetFolderInfo(folder) Set colFiles = oFolder.Files Set strFileList = "" aqString.ListSeparator = "," While colFiles.HasNext Set f = colFiles.Next strFileList = aqString.AddListItem(strFileList, f.Name) Wend ListFiles = strFileList End Function2.4KViews0likes0CommentsRe: Another WaitWindow/Exists thread
WaitWindow doesn't raise an error if it fails to find the desired object. That implies that the error is coming from this part: Aliases["BLAH32"]["dlgBlah"] That's the object that doesn't exist. TC is taking some time to find it (the "Auto-wait timeout" defined in your project properties), failing to find it, then because you are trying to call a method of the missing object, you get the error.1.1KViews0likes0CommentsRe: Silverlight Object hierachy becomes misaligned/jumbled when scroll methods are invoked.
Ah, multiple TextBlocks in each item, so the NativeUIAObject.Name is probably just a class name that's the same for all items, right? Tricky. I agree that TC does have problems with Silverlight objects, and it certainly needs work, but I've found that it's not always as bad as it appears. It seems to me that the real problem lies with the Object Browser panel. The tree that you see in the Object Browser does often get badly out of sync with what's really on screen, and that seems to interfere with scripts. But in general I have found that there are no problems while actually running scripts that deal with the same objects, as long as I haven't used the Object Browser beforehand. That means that I often have to restart TC or go through various other rituals in order to get a script written, but once it's written it works OK at runtime. Very annoying, yes, but manageable. There may be another workaround for your situation. I assume that you are searching for the desired TextBlock by calling FindChild from the ListBox object, is that right? Instead of that, you may be better off if you first use FindAllChildren to find all the visible ListBoxItems, and from each of those call FindChild to find the TextBlock within and see if it's the one you're looking for. If it is, you already have what should be a valid and correct reference to its parent. If you get through the whole set of visible ListBoxItems without finding the item you want, then scroll a bit, refresh, and try it all again.1.2KViews0likes0CommentsRe: Silverlight Object hierachy becomes misaligned/jumbled when scroll methods are invoked.
You do exactly the same thing? From your first post it looked like you were looking for the TextBlock containing the string you wanted and calling AddToSelection on its parent. If the tree has been rearranged, the Parent property might not be reliable. My method is to ignore the TextBlock in favor of the "NativeUIAObject.Name" property of the ListBoxItem itself. That way, the object returned by the search is the same one you call AddToSelection on, and you don't have to rely on the Parent being correct and up to date. That method should always work, regardless of how "jumbled" the tree has become. I'm not sure what you mean by revisting the listbox, but you should always search for the item you want, rather than trying to reuse a reference to the item from an earlier part of the test. Silverlight is free to reorganize and reuse the objects within list and combo boxes, so you can rarely assume that an old ListBoxItem reference is still good.1.2KViews0likes0CommentsRe: Silverlight Object hierachy becomes misaligned/jumbled when scroll methods are invoked.
I've noticed this as well, but it hasn't stopped me selecting the item I want. I usually use FindChild on the list/combobox, looking for an item with NativeUIAObject.Name equal to the string I'm looking for. Then I call AddToSelection on whatever object is returned. If I have to scroll the list, I refresh it afterwards and call FindChild again. It's always worked for me.1.2KViews0likes0Comments