ContributionsMost RecentMost LikesSolutionsValidate a time with allowance for seconds to be off I have a label that reports the time and I am validating it. Usually it's ok, but sometimes the check is done a few seconds late, and so the label appears to be wrong. How could I allow for a few seconds to be wrong without it failing the test? I am using Javascript as my written scripts. SolvedRe: Cannot find dotNET child objects Yes, that was one of the first things I checked. The extension was already installed. Re: Cannot find dotNET child objects Also appears to be 32 bit, but still doesn't work. Re: Cannot find dotNET child objects It appears that the library is 32 bit. I tried running the test with the "preferred architecture of the assembly hosting process to be" both 32 and 64 bit, but neither worked. Cannot find dotNET child objects I have a project that I was able to run in TestComplete 12. I recently installed TC 14 onto a new computer and copied the scripts into a new project. Now, I'm getting a JavaScript runtime error that the object I'm trying to use is undefined. My code is simple: dotNET.System_Management_Automation.PowerShell.Create().AddScript(command).Invoke() but now it can't even compile because the System_Management_Automation object is undefined. I did add the System.Management.Automation assembly to the CLR Bridge as instructedhere. The code completion window shows absolutely nothing for dotNET after I hit the period (it does autocomplete dotNET, nothing after). What am I missing to get PowerShell functional again? Re: Object sometimes doesn't support Exists That seems to have done the trick. I might figure out a way to refine it later on to not use the same code twice, but rather make it a call, and to quit trying if it still fails after a refresh. But for anyone in the future curious of a solution, here's how I fixed my error. function findKey(propertyName, character, shiftMode) { var keyboard = getKeyboard() if (keyboard == null) { Log.Error("Keyboard was not found.") return } keyboard.set_ShiftMode(shiftMode) var key = keyboard.FindChild(propertyName, character, 2, true) // Sometimes key.Exists will crash. If it does, catch the error and refresh. try { if (key.Exists) { key.Click() return true } } catch (error) { key.RefreshMappingInfo() if (key.Exists) { key.Click() return true } } return false } Re: Object sometimes doesn't support Exists Based on your suggestion I added a check for that: var keyboard = getKeyboard() if (keyboard == null) return var key = keyboard.FindChild(propertyName, character, 2, true) ... It still crashes. I didn't think it was a problem with the keyboard anyway, as my last comment shows that the found child exists and is not null. Re: Object sometimes doesn't support Exists Here's the code to get the keyboard. This is a desktop application. function getKeyboard() { var activeView = Aliases.AppName.HwndSource_Window.WindowTouchViewmodelsShellview.ShellView.Grid.ActiveItem if (activeView.LoginView.Exists) { return activeView.LoginView.Grid.SoftKeyboard } else if (activeView.HomeView.Exists) { return activeView.HomeView.Grid.SoftKeyboard } else return null } I have tried a couple of other things in my findKey() function. I tried setting the shiftMode before finding the key, and it still crashes. I also tried changing the properties in my FindChild call to look like this var key = keyboard.FindChild([propertyName, "Exists"], [character, true], 2, true) And it still failed. To add something else to help, here are some screenshots of the info I'm checking when I set a breakpoint on the line that fails. As you can see, especially from the last one, the object has the property, but it doesn't actually work when calling it. Re: Object sometimes doesn't support Exists Our software uses a soft keyboard. It can be located in one of two different screens. So the getKeyboard() function is a little helper that checks for whichever screen is active and returns the keyboard. There is also a function I run right before this one that just clicks every key to make sure they work. That code is below. As for the FindChild() function, that was just a typo. I'm surprised it didn't crash there if it wasn't the right case. I switched it over to the proper name and it still failed. function enterAllKeys(textField, shiftMode) { // Clears the text and gives focus textField.Keys(clearAll) var keyboard = getKeyboard() keyboard.set_ShiftMode(shiftMode) // Holds the entered text to make sure all the keys worked. var enteredKeys = "" Log.Message("Testing all keys in Shift Mode: " + shiftMode) for (var i = 0; i < keyboard.ChildCount; i++) { var key = keyboard.Child(i) enteredKeys += Chr(key.Child(0).activeChar()) key.Click() } aqObject.CheckProperty(textField, "wText", cmpEqual, enteredKeys) } Re: Object sometimes doesn't support Exists Thanks for the suggestion. Unfortunately, even when wrapped in that null check it still fails the key.Exists line.