Contributions
Re: .NET Connected.TestedApps["Items"]("appName") execute well in TC IDE, but giving null exception in C
Dear Alex, Thank you for detailed response. Actually here is what our automation team is doing, their testing scenarios: There are 2+ .xlsx files, the first one is batchInit.xlsx file having data as follows: SeqNo Key/Action Excel Path Tab Iterations Data Column 1 CheckApp D:\TestComplete\TC_XlsRdrTestApp\XlsRdrApp.exe cms_app 1 0 2 SwitchUser netsol1 a/netsolpk1 1 29 3 TestCase D:\TestComplete\CmsRN.xlsx PickApplication 2 29 And the additional files contains Test-Case instructions e.g. CmsRN.xlsx file has data as follows: Step# Mapped Object Action QATC1 1 readVariables Contracts 2 Aliases.cms_app.CMS selectMenu Management|Workflow|Pick/Re-Pick CAP Deals 3 Aliases.cms_app.RetrievalOptions.RetrieveDatewise skip 4 Aliases.cms_app.RetrievalOptions.Main.FromDate skip 5 Aliases.cms_app.RetrievalOptions.Main.ToDate skip 6 Aliases.cms_app.RetrievalOptions.OK set 7 tooltip SearchApp 8 SearchOptions.ApplicationNo check set 9 delay 2000 10 Aliases.cms_app.SearchOptions.AppNo set #2 11 delay 2000 12 Aliases.cms_app.SearchOptions.ApplicationType check set 13 Aliases.cms_app.SearchOptions.ApplicationType check unset 14 Aliases.cms_app.SearchOptions.Close set close 15 delay 2000 16 Aliases.cms_app.CMS.mainWindow.PickWindow.Main.Text("applicant_name") set application_name 17 delay 2000 18 Aliases.cms_app.CMS tooltip PickApp 19 delay 10000 20 Aliases.cms_app.Window("#32770", "Success", 1).Window("Button", "OK", 1) button 21 Aliases.cms_app.CMS tooltip Close The automation team has written scripts in Test-Complete for different command processing. One process start reading first file and process steps mentioned in it e.g Step1: CheckApp, test weather specific application is in the list on TestdApp.Items list and validate its Fullname+Path. Step2: SwitchUser, check it application is running, terminate it and re-execute the app. Step3: TestCase, reads the 2nd Test=Case file specified with Path, open it and give the table to the 2nd Process which actually runs the Test-Case steps. The 2nd process runs the test case Actions using Mapped-Object with the test data given in QACT1 column. So my task was to convert all those scripts written in TC-Scripts, into a Dll, so we can give the Dll to our testing resources running TC, they will prepare the .xlsx files and run automation. Before we give our testing resources the whole project .pjs folder, they open the project and prepare .xlsx sheets, and run the automation. Now one of our client has request, they will buy the Test-Complete. Since they do not have technical-testing resource, they want us to give them the testing framework i.e. Testing-Scripts we had developed, so that they will run the .xlsx file w.r.t the newly Change-Request implemented in the software on their site for integration testing. That is why we want to convert the testing-scripts framework to put in VB.Net Dll, so user cannot change the scripts, and only focus on integration side only. Thanks.2.1KViews0likes2CommentsRe: .NET Connected.TestedApps["Items"]("appName") execute well in TC IDE, but giving null exception in C
Hi Alex, Now I changed the Connected App scenario, I put my code in a VB.Net Dll, and I added the Dll in TC using CLR_Bridge. It was successfully registered in, I write following code Sub TstXlsRdr Dim p p = dotNET.CMSIntergrationLib.DriverTC.ProcessBatchFile("D:\TestComplete\BatchRN2.xlsx", "CTA") End Sub The subroutine reads an excel file successfully, Connect.Log.Message can also successfully write the strings in TC log. But as I try to read following statement it give error [Object variable or With block variable not set] Private Function CheckRegApps(appName As String) As String Dim AppName As String = appName Dim tstAppObj Try tstAppObj = Connect.TestedApps.Items(AppName) Catch ex As Exception Throw ex End Try End Function What is wrong with this code, looks like tstAppObj is unable to get TestedApp type of object. I am new to TC environment, please need guideness in this matter.2.1KViews0likes4Comments.NET Connected.TestedApps["Items"]("appName") execute well in TC IDE, but giving null exception in C
This code execute successfully in TC-IDE function Test1() { var appName = "TestApp"; var appObj = TestedApps["Items"](appName); if (appObj != null) { Log["Message"](appObj["ItemName"]); Log["Message"](appObj["FullFileName"]); } } but giving null exception in C# ConnectedApp: using tcVar = AutomatedQA.script.var; using AutomatedQA.TestComplete; public static void StartApp(string AppName) { tcVar app = AppNAme; tcVar appObj = Connect.TestedApps["Items"](app); if (appObj != null) { tcVar str = "The project contains following TestedApps: " + objApp["FileName"]; Connect.Log["Message"](str); str = "Full Name with Path of Application: " + objApp["FullFileName"]; } } What is wrong with my code. I had write the same code using VBScripts in TC-IDE, it runs OK, but same error if i tried to run in VB.NET connected app. An early response will be appreciated.Solved2.2KViews0likes7Comments