Forum Discussion
Hi Simon,
This is a very common ask, and should be pretty easy to setup once you see the steps.
In a Keyword Test, go to the Statement section of the operations panel and grab the Set Variable Value Operation.
First step is using the Set Variable Value to create a variable, once it is created, you need to set the Value for that variable.
Setting this can be done just like customizing a log message.
https://support.smartbear.com/testcomplete/docs/testing-with/log/posting/variables.html
- simon_cnhi3 years agoOccasional Contributor
Hi brumazz,
Thanks for the info. I decided to take a different route because Google, in their infinite wisdom, have decided not to use the "regular" MSI field value "version" to store the version of Chrome, so, I generated an INI file instead -
I can now read the INI file and define the variables I wish to use for a Keyword Test
So, the question now is (hope it's ok to post in same thread), how do I use the variables "chromeProductCode" & "chromeVersion" as input into an application's respective fields, during a Keyword test.
Is there an online article you can point me to? Also, will the Keyword test have to be fully scripted?
cheers in advance
Simon
- brumazz3 years agoSmartBear Alumni (Retired)
Hi Simon,
Keyword tests do not require any scripting, though you can use Code snippets or reference script tests from a keyword test.
As for the variables, please see this video to see if it helps
https://www.youtube.com/watch?v=huWhD_gN0Nc
- simon_cnhi3 years agoOccasional Contributor
Hi, thanks brumazz, for the video link. It has pulled the veil back slightly on using variables. Sorry to be so dim on this, I only started using TestComplete last week.
The test I'm developing has to read the product code and version of a Chrome installation MSI file, which is automatically download weekly, from Google. Then, I need to use the information (productcode and version) in a 2nd application, within which two separate fields (text boxes) have to have the productcode and version set to the values extracted from the Chrome installer MSI. These values are different every week.
To make it more difficult the productcode can be read directly from the MSI installer file, but, the product version can only be read from the registry once the new version of Chrome has been installed. That's the easy bit for me. I've generated an INI file to facilitate the data import into the test, using some script.
If there's a way to do the above without using script at all, that would be perfect and keep things simple.
many thanks for your help.