UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.
Absent Member.
1591 views

EnvironmentVariable with silkCentral

Jump to solution

Hi All,

Can we define an EnvironmentVariable with silkCentral then get this variable with the comand

Environment.GetEnvironmentVariable("myParam") within silkTest Workbench.

thank you in advance.

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Hi,

In Silk Central 16.0 you have to create an Input Parameter for the .NET script having the same name as the parameter in Silk Central:

 

Configure the parameter in Silk Central:

In the Workbench specify an input paramter for the script and get the passed value like shown in the sample below:

    Public Sub Main(args As IDictionary(Of String, Object))

         

          With _desktop.Window("Untitled - Notepad")

                 .TextField("TextField").TypeKeys(args("myParam"))

          End With

         

    End Sub

Using environment variables might be implemented in SC 16.5.

Best Regards,

Sebastian

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Hi,

In Silk Central 16.0 you have to create an Input Parameter for the .NET script having the same name as the parameter in Silk Central:

 

Configure the parameter in Silk Central:

In the Workbench specify an input paramter for the script and get the passed value like shown in the sample below:

    Public Sub Main(args As IDictionary(Of String, Object))

         

          With _desktop.Window("Untitled - Notepad")

                 .TextField("TextField").TypeKeys(args("myParam"))

          End With

         

    End Sub

Using environment variables might be implemented in SC 16.5.

Best Regards,

Sebastian

View solution in original post

0 Likes
Absent Member.
Absent Member.

Thank you for your response. I have already tested input parameters in SCTM but it doesn't meet my needs. In fact I don't want to manage those parameters in each script  it's why I think that environment variables  offers more flexibility.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.