ProjectSuite.Variables.Path is undefined in OnStartTestHandler
I would like the pjs path in the OnStartTestHandler event handler to prefix to a TestedApps application. When I run my test ProjectSuite.Variables.Path is undefined. Is there another way to get the pjs path in the OnStartTestHandler event handler? This is my javascript code function UpdateFilePath(testedApp, path) { let app; // Obtains the tested application's item app = TestedApps.Items(testedApp); Log.Message(`Start: ${app.Path} --- ${app.FileName}`); app.Path = ProjectSuite.Variables.Path + path; Log.Message(`End: ${app.Path} --- ${app.FileName}`); return app; }Solved25Views0likes1CommentHow To: Read data from the Windows Registry
Hello all, I have recently learned how to retrieve data from the Windows registry in JavaScript test units. I am using this to return the OS information and application path information. This is very useful when added to the EventControl_OnStartTest event code. This will allow you to return OS information and other needed data at each test run. Some test management systems may provide this information for you or it may be logged in the in data produced in a pipeline run. This will embed the information directly into your test log. SmartBear KB Links: Storages Object Storages Object Methods Storages.Registry Method Section Object Get SubSection Method This bit of code will return the Product Name and Current Build from the registry. This location may vary between OS's so you will want to check this with RegEdit. let Section = Storages.Registry("SOFTWARE\\Microsoft\\Windows NT", HKEY_LOCAL_MACHINE); let regKeyString = Section.GetSubSection("CurrentVersion").Name; let productIdString = Storages.Registry(regKeyString, HKEY_LOCAL_MACHINE, 1, true).GetOption("ProductName", ""); let currentBuildString = Storages.Registry(regKeyString, HKEY_LOCAL_MACHINE, 1, true).GetOption("CurrentBuild", ""); Log.Message("Windows Version: " + productIdString + " Build: " + currentBuildString ) I have also found the need to find and set an application path and work folder in the project TestedApp for running through a pipeline because the pipeline deploys the application to a non-standard path. let Section = Storages.Registry("SOFTWARE\\WOW6432Node\\<_yourSectionName>\\", HKEY_LOCAL_MACHINE); let regKey = Section.GetSubSection(<_yourSubSectionName>).Name; let Path = Storages.Registry(regKey, HKEY_LOCAL_MACHINE, 0, true).GetOption("", ""); let WorkFolder = Storages.Registry(regKey, HKEY_LOCAL_MACHINE, 0, true).GetOption("Path", ""); let appIndex = TestedApps.Find(<_yourAppName>); if (appIndex >= 0){ if(TestedApps.Items(<_yourAppName>).Path != Path){ TestedApps.Items(<_yourAppName>).Path = Path } if(TestedApps.Items(<_yourAppName>).WorkFolder != WorkFolder){ TestedApps.Items(<_yourAppName>).Params.ActiveParams.WorkFolder = WorkFolder; } } else{ Log.Error("TestedApp " + <_yourAppName> + " does not Exist.") Runner.Stop(true); } I hope you find these links and code examples as useful as I have! Have a great day!26Views0likes0CommentsName Mapping not working on remote browser
The name mapping and test cases work fine on local browsers, but would complain about page or object not found when running headless remote browsers and in parallel testing. I have the following setup for browser name mapping: For headless setup I have: server = "localhost" capabilities = { "browserName": "chrome", "headless" : "true", "screenResolution": "1920x1080", "platform" : "Headless", "record_video": "true" } Browsers.RemoteItem[server, capabilities].Run(url) Is this the correct way to work with name mapping on headless browser?995Views0likes15CommentsAzure Pipelines - Runs on TestComplete instead of TestExecute
Hi all, So it seems like my UI tests are running with TestComplete instead of TestExecute and im trying to figure out why. In my pipeline i do request to use/prefer TestExecute: But for some reason it will run them with TestComplete and therefore consume a license which are supposed to be dedicated to my testers. So 5 TC licenses and 7 TE licenses and 6 agents running UI tests at night. Since they seem to run TC many pipeline are failing since they cannot acquire a license. I guess my next solution would be to install only TE on the agent's machines but i like to have TC there for debugging purposes. It was working just fine a few weeks ago... What could be causing this issue?25Views0likes2CommentsTestComplete cannot find chrome webdriver
Hello, I am trying to get TestComplete to run headless tests. I am following this guide https://support.smartbear.com/testcomplete/docs/app-testing/web/supported-browsers/headless.html#local and I am running into the issue that TestComplete cannot download/see the needed WebDriver. This is the JavaScript used in the guide. function Test_Chrome_Headless() { var server = "localhost"; var capabilities = { "browserName": "chrome", "screenResolution": "1920x1080" }; var url = "myurl"; Browsers.RemoteItem(server, capabilities).Run(url); } I downloaded the chrome driver manually and created the path as shown above. But even with the driver in the correct location he cannot seem to open it. When I try to open the driver myself, it works. Does anyone have an idea what I am doing wrong? Kind regards, Luuk615Views0likes4Commentshow to run different sets of tests via TestExecute
Hi guys, I'm curious, what's your strategy to run different sets of tests from command line/CI? I found no way to dynamically enable/disable items in Execution plan. I mean, I have a set of tests to delete/create some reference resources (CreateResources). This set needs to be run once a day. And then I have RegressionTests group, which I want to run once or multiple times a day. I tried to utilize /t: parameter with the name of appropriate test group. Unfortunately, TestExecute starts, but no test stored in either group is started. And yes, all tests and groups/subgroups are enabled (TC doc says that TC will run only the enabled test items). Thanks for any idea.Solved33Views0likes2Commentshow to run custom scripts after project suite Run is completed
We have developed custom code in python to generate html based Summary report using the data available in the TestComplete provided Junit summary report xml file. At the end of execution i want to generate Junit summary report xml file and then I want to run this custom code. I am not sure when and where i can trigger this custom code after all the test execution is completed? Also it should get triggered in both commandline and using Test complete GUI. Any thoughts how to achieve this?61Views0likes10Comments