timeout while waiting for a window (such as explorer, etc).
I have a main method in C# using Visual Studio. The important part is public void reprice() { ... try { test1(); } catch(Exception ex) { System.Diagnostics.Debug.WriteLine("place a break point here"); } ... } with the expectation that anything in test1() causing an exception I can catch. test1() has my Test Complete (12) code in it. The entire test worked fine. A teeny subset: pubclic void test1() { ... Connect.NameMapping["Sys"]["Keys"]("[Hold][Win]e[Release]"); wndCabinetWClass = explorer["wndCabinetWClass"]; } the second line beginning with wnd depends on the [Win]e above it top open a windows explorer window. To simulate an error, I commented out the Connect line. When I run it, I get the message "waiting for the wndCabinetWClass...", which is exactly what I would expect. The problem is, it does not seem to time out. It gives the message, and when the dots get to the end, it starts over again, and never seems to timeout. As you can see from the attached picture, my auto wait timeout is 10000 ms (10 sec), but this thing is still waiting after minutes. It takes a while for some windows to come up, but I would think 60 seconds is good enough. I found a suggestion to do "Options.Run.Timeout = 30000;", however my code cannot find Options. So I am not sure what to do. I guess it will eventually time out when the test has reached its maximum time, but that could be 30 minutes.1.6KViews0likes1CommentCannot create Test Complete Object
I am new to Visual Studio / Test Complete / C#. I have written a Test Complete test in C#, but when I try to run it it says "Cannot Create Test Complete Object". The only question so far that I have found does not apply to me. Even if it did, I did, as it suggested, run the program as admin but the same problem. This is nowhere near enough information for you to go on, so let me continue. My Test Complete test extends a class "AbstractTestCase" that we got from our team. This is the base class that has been used for years, so I am sure it is OK. I made a simple test, just to try to click an object. I have no idea whether the values are correct, but for now it does not matter, as my test is throwing an exception in the "Before()" method, so it has not gotten there yet. The exception is being thrown at this method, which I believe is Smart Bear method, so I cannot debug into it, and it shows no line number: Connect.RunTest(GetTestName(), "Generic", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Automation\TcFramwork\TcFramwork.pjs"); The values are as follows: GetTestName() ="RepriceTest" Path.GetDirectoryName... ="C:\\VS_Projects\\ErepricerSolution\\ErepriceClassLibrary\\bin\\Debug\\Automation\\TcFramwork\\TcFramwork.pjs" I do have a fileC:\\VS_Projects\\ErepricerSolution\\ErepriceClassLibrary\\bin\\Debug\\Automation\\TcFramwork\\TcFramwork.pjs which looks like this (along with a "Generic" subdirectory). Please see attached file. To attach it I had to convert it to an XML file. The only difference is this. Because my Desktop started crashing, I was one of the first (and only so far) people to get a laptop. Others will be getting themn as time goes on. The laptop has Windows 10, while everyone else has Windows 7. The Laptop has Test Complete 12. The laptop had Visual Studio 2015, but due to compiler incompatibilities with Smart Bear Connetc, I had to have Visual Studio 12 installed, which I am using. So others are using Windows 7, Visual Studio 12 and Test complete 12, while I am using Windows 10, Visual Studio 12 and Test Complete 12. I do see somewhet of a backtrace from this Connect.RunTest(), so maybe someone can figure out what's going on. Please see attached file trace.png. I am also attaching a copy of my test class. (And again I have no idea whether the Connect statement is right, but it never gets that far)2.7KViews0likes3CommentsRegistry key is not getting added for auto Login using C# script.
Hi, I am trying to write registry key for auto login using C# script. The script is getting executed, but the registry is not getting added. My code is shown as below: Initially I was getting an error stated as "Registry root is invalid",but running Test Complete as Administrator, the problem got solved. Now, that thescript is getting executed registry is not getting updated.Please help. function Test_FWC_UTL_Registry_Write_Registry_Key_Value() { var strKey strKey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" FWC_UTL_Registry_Write_Registry_Key_Value (strKey, "DefaultUsername", "REG_SZ", "XXXXXXXX") } function FWC_UTL_Registry_Write_Registry_Key_Value(strRegistryKey, strRegName, strRegType, strRegKeyValue) { var WshShellObj,OutputVal WshShellObj = Sys["OleObject"]("Wscript.Shell") OutputVal = 0 if (WshShellObj == null) { GL_ErrMessage = "Couldn't able to create Shell object" } else { WshShellObj.RegWrite(strRegistryKey + "\\" + strRegName , strRegKeyValue, aqString["ToUpper"](strRegType)) WshShellObj = null OutputVal = 1 return OutputVal; } }Solved4.2KViews0likes9CommentsC# Script implementation of VB script.
Hi, I am trying to write registry. I have a .vbs file which write the server registry for auto login as administratorafter a reboot. I am trying to integrate it as a C# script but getting run time error from the If statement as shown below. The code inside the .vbs files is as shown below. Please help. If WScript.Arguments.Named.Exists("elevated") = False Then CreateObject("Shell.Application").ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ /elevated", "", "runas", 1 WScript.Quit End If Set objShell = WScript.CreateObject("WScript.Shell") objShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon", "1", "REG_SZ" Set objShell = Nothing1.9KViews0likes3Comments