How 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!57Views0likes0CommentsKeyword Test Names not in Sync with Execution Plan
Hello, New to TestComplete. created a number of Keyword Tests and used these tests to build an Execution Plan. I later edited the Keyword test names so they were more descriptive however noticed that the Keyword tests in the execution plan names are no longer in sync. Is there and option to force the Execution plan to update using the updated Keyword test names? or must I rebuild the execution plan from scratch?47Views0likes6CommentsVideo recording of Text Execution
Hello to everyone! I installed the VideoRecorder Extension and the last version of VLC Media Player. When I try to record a test execution in the log tab the following sentence appears: "Unable to start video recording. The VLC recorder is not installed." Why does this message appear? I uninstalled and installed again VLC but it continues to appear. How could I solve this problem? Thanks in advance to everyoneSolved1.1KViews0likes7Commentsrelease 15.59.7.7 cannot detect embeded chromium content
Tests started to fail on web related tests after upgrade to 15.59.7.7. It cannot detect web or embedded chromium content although Testcomplete web module licence is connected. *Logout and login did not help. *Downgrade the testcomplete to 15.41.9.7, Left the Testexecute on 15.59.7.7. * Testcomplete could detect web and embeded chromium content., tests run successful with testcomplete, but problem remain when running the same tests with test execute. * Downgrade the test execute alto to release 15.41.9.7, all worked back again. Note: did not touch project or any settings at any point and it was already working before the upgrade, so downgrading resolved.280Views0likes6Commentschanging dropdown menu field for every testing
Hi Guys, what I want the system to do: I will check a field, it is a dropdown menu, and if this field is for example A, I should select another option for example B for this field from the dropdown list. Or if this field is B I should change it to A so how can I do it with scripting? Do you have an idea? I could have not found the correct codes for this:( For example in one test the field contains A and you should change it to B, than for the next time the field is B and you should change it to A.383Views0likes1CommentError running test on build machine - The Stores project node does not exist.
Hi all, so i have a few tests which have initially been created to compare some images. Those images are stored in the Stores\Regions of my project. Locally everything run fine. However, when those tests runs on the build server they fail with the following error: The Stores project node does not exist. However the project seems correctly configured and the Stores node exists: i also verified the .mds and seems normal: Whats even more odd, is that the failing test also fail if i remove the tests steps which uses the store. All other tests inside the project/solution works well. Anyone have a clue of what could be wrong here?427Views0likes8CommentsHow to increment a variable value when using Genarte Data to test
I am trying to create a test scenario for creating a new account. Whenever I run the test case I want to use a new name value for the account I create, so I am using Generate data and use the Name option and first name. Still, whenever I run the test, it only shows the 1st name in that column; when I run the test 2nd or 3rd time, it uses the same name every time. can anyone help me with this issue, I don't know programming or how to use VB script or Java script. appreciate your help and support. thanks, Gill414Views0likes1Commentabout month name differences
Hi Guys, I have a problem with the dates again. My computer language is Deutsch and my testing area is English. So I want to select for example a day in december but the test complete try to find the dezember instead of december, so how can I convert the month dates by using scripts?167Views0likes4Comments