Contributions
Re: TestExecute via COM, Unable to find namespace 'TestExecute'
Simon, thank you for continuing to troubleshoot with me. I am running TE 9.3 and have the following 2 statements using AutomatedQA.script; using AutomatedQA.TestComplete; Both are recognized by Visual Studio as valid. Putting "using TestComplete" oddly enough is not recognized. Admittedly, I have never done any 3rd party dll referencing before. Is there anything that must be done beyond adding the references to the project and the necessary using statements? It looks like the AutomatedQA.script.dll is being referenced correctly as all of those lines are recognized. However, anything for the AutomatedQA.TestComplete.CSConnectedApp.dll is not. I did however do the same exact process for adding both.1.4KViews0likes0CommentsRe: TestExecute via COM, Unable to find namespace 'TestExecute'
Simon, Thank you for pointing that out. I most likely would have run into that after resolving the current issue However, as it stands right now I can't compile due to the following 2 lines: TestComplete.ITestCompleteCOMManager TestExecuteManager = (TestComplete.ITestCompleteCOMManager)TestExecuteObject; TestComplete.ItcIntegration IntegrationObject = TestExecuteManager.Integration; I am getting the Error: "The type or namespace name 'TestComplete' could not be found (are you missing a using directive or an assembly reference?)" on the 3 mentions of TestComplete Anything look wrong with those? It is right from the documentation.1.4KViews0likes0CommentsTestExecute via COM, Unable to find namespace 'TestExecute'
I am attempting to integrate TestExecute with our C# application via COM objects. I have followed the documentation as closely as possible fromhere. 1. I have added the assembly references to my solution (AutomatedQA.script.dll and AutomatedQA.TestComplete.CSConnectedApp.dll) 2. I have added the necessary "using" statements to my code using AutomatedQA.script; using AutomatedQA.TestComplete; However, I still have an unrecognized namespace "TestExecute" when I try to get the TestExecuteManager and Integration object. These are the only 2 problem lines. All other references look to be valid. Is the documentation still valid? Am I doing this incorrectly? private void RunTestGroup(string testName) { const string TEProgID = "TestExecute.TestExecuteApplication.9"; object TestExecuteObject = null; try { TestExecuteObject = Marshal.GetActiveObject(TEProgID); } catch { try { TestExecuteObject = Activator.CreateInstance(Type.GetTypeFromProgID(TEProgID)); } catch {} } if (TestExecuteObject == null) return; /* * These are the problem lines */ // Obtains ITestCompleteCOMManager TestComplete.ITestCompleteCOMManager TestExecuteManager = (TestComplete.ITestCompleteCOMManager)TestExecuteObject; // Obtains Integration object TestComplete.ItcIntegration IntegrationObject = TestExecuteManager.Integration; IntegrationObject.OpenProjectSuite(@"C:\TestComplete\Tests\SalesPadTest\SalesPadTest.pjs"); while (!IntegrationObject.IsRunning()) System.Threading.Thread.Sleep(1000); if (!IntegrationObject.IsProjectSuiteOpened()) { Console.WriteLine("Could not open the project suite. EXITING."); // Closes TestExecute TestExecuteManager.Quit(); // Releases COM objects Marshal.ReleaseComObject(IntegrationObject); Marshal.ReleaseComObject(TestExecuteManager); Marshal.ReleaseComObject(TestExecuteObject); return; } try { // Runs the test IntegrationObject.RunProjectTestItem(testName); // Waits until testing is over while (IntegrationObject.IsRunning()) System.Threading.Thread.Sleep(1000); // Check the results switch (IntegrationObject.GetLastResultDescription().Status) { case TestComplete.TC_LOG_STATUS.lsOk: Console.WriteLine("The test run finished successfully."); break; case TestComplete.TC_LOG_STATUS.lsWarning: Console.WriteLine("Warning messages were posted to the test log."); break; case TestComplete.TC_LOG_STATUS.lsError: Console.WriteLine("Error messages were posted to the test log."); break; } } catch (System.Runtime.InteropServices.COMException ex) { Console.WriteLine("An exception occurred: " + ex.Message); } finally { // Closes TestExecute TestExecuteManager.Quit(); // Releases COM objects Marshal.ReleaseComObject(IntegrationObject); Marshal.ReleaseComObject(TestExecuteManager); Marshal.ReleaseComObject(TestExecuteObject); } }5.9KViews0likes6CommentsVariable for connection string or Data Source Name?
Hello, I have been dynamically building my database connection string through scripting as I perform testing on SQL 2005, 2008, and 2012, which all could have a different SQL Driver. I am now seeing the need to create Database Checkpoints as opposed to checking specific values. The problem I am running into is that when creating the DB Checkpoints, TestComplete requires me to either enter a Data Source Name or enter a connection string, both of which could be different based on which machine the testing is occurring on. So my question is, is there a way to pass a variable for the connection string or the Database Source Name for these checkpoints? Is there a better way to do this, like populate a temporary table from a query then compare that to a data object? Any help is appreciated. Code for retrieving the connection string: function GetConnectionString() { var Connection; var Key, ValueName; var regEx, SQLVersion, SQLDriver; // Gets an object for the Windows system registry key Key = Storages.Registry("Software\\Microsoft\\MSSQLServer\\MSSQLServer\\CurrentVersion", HKEY_LOCAL_MACHINE); // Specifies the name of the value you want to obtain ValueName = "CurrentVersion"; SQLVersion = Key["GetOption"](ValueName, "Not Found"); regEx = /^\d*/; // Perform search operation Match = SQLVersion["match"](regEx); if (Match == "9") SQLDriver = "SQL Native Client"; else if (Match == "10") SQLDriver = "SQL Server Native Client 10.0"; else if (Match == "11") SQLDriver = "SQL Server Native Client 11.0"; Project["Variables"]["Connection_String"] = "Driver={"+ SQLDriver +"};Server="+ Sys["HostName"] +";Database=TWO;Trusted_Connection=yes;"; Log["Message"]("SQL Connection String: "+ Project["Variables"]["Connection_String"]); }12KViews0likes5CommentsChange Parameter for each iteration
Hello, I have a basic set of tests designed for the 'Release' branch of our software. We are now wanting to test 3 more branches with the same set of tests. Is there a way to pass a different value for each iteration of my 'Install' test? For instance, 'Release' for first, 'HotFix' for second, etc. Ideally, I'd like to pass this string to one of my tested apps that retrieves the correct install file. I looked into using the Parameters on the Test Item. However, I could only list one and could not find any information on listing 4 strings and going to the next after the current iteration. Am I going about this all wrong? Is there a better way to do this in TestComplete? Thanks in advance. Elliot21KViews0likes1CommentChanging Tested App with Same Tests
Hello, I am wondering if there is an easy way to swap out the Tested App used for a test. My company's software makes small changes between versions, small enough that the steps already created will work between versions. However, I am unable to find a good way to do this. I have added a newer version into the TestedApps of the Project, but clicking on the current Test App within the test yields no way to "swap" in the newer version. Any help would be appreciated, thanks!17KViews0likes2Comments