Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » How Can I fetch environment variable in RCPTT? (I need to fetch an environment variable in rcptt test case. The variables value is coming at runtime.I tried using the command :"global [val TestVar [ substitute-variables " ${system_propert)
How Can I fetch environment variable in RCPTT? [message #1776952] Thu, 23 November 2017 08:24 Go to next message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
I need to fetch an environment variable in rcptt test case. The variables value is coming at runtime.I tried using the command :"global [val TestVar [ substitute-variables " ${system_property:Test_User}"]] "; but it didn't work.Could anybody please let me know the proper solution?
[/color]

[Updated on: Mon, 11 December 2017 06:36]

Report message to a moderator

Re: How Can I fetch environment variable in RCPTT? [message #1777642 is a reply to message #1776952] Fri, 01 December 2017 08:47 Go to previous messageGo to next message
Viktoria Dlugopolskaya is currently offline Viktoria DlugopolskayaFriend
Messages: 124
Registered: March 2017
Senior Member
Hi Mayur,

Try to use 'invoke-static' command to get it with java method:
proc "get-env" [val name] {
	invoke-static "org.eclipse.rcptt.util" "java.lang.System" getenv $name
}

get-env "PATH" | log
Re: How Can I fetch environment variable in RCPTT? [message #1778127 is a reply to message #1777642] Mon, 11 December 2017 06:21 Go to previous messageGo to next message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
No Message Body

[Updated on: Mon, 11 December 2017 06:30]

Report message to a moderator

Re: How Can I fetch environment variable in RCPTT? [message #1778128 is a reply to message #1777642] Mon, 11 December 2017 06:21 Go to previous messageGo to next message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
No Message Body

[Updated on: Mon, 11 December 2017 06:30]

Report message to a moderator

Re: How Can I fetch environment variable in RCPTT? [message #1778130 is a reply to message #1777642] Mon, 11 December 2017 06:28 Go to previous messageGo to next message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
No Message Body

[Updated on: Mon, 11 December 2017 06:30]

Report message to a moderator

Re: How Can I fetch environment variable in RCPTT? [message #1778131 is a reply to message #1777642] Mon, 11 December 2017 06:28 Go to previous messageGo to next message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
No Message Body

[Updated on: Mon, 11 December 2017 06:31]

Report message to a moderator

Re: How Can I fetch environment variable in RCPTT? [message #1778132 is a reply to message #1777642] Mon, 11 December 2017 06:28 Go to previous message
Mayur Sancheti is currently offline Mayur SanchetiFriend
Messages: 6
Registered: November 2017
Junior Member
Thanks for Reply.@ Viktoria Dlugopolskaya :-)

I was facing issue mentioned below:-
I needed to fetch the value of the variable which will have declared on terminal using export command.
Example: "export TEST_USER=XYZ;"

The value of this TEST_USER will be limited to that terminal session only and It has to come at runtime and I needed to fetch this value.

I was able to fetch environment variables like JAVA path etc.
But I was not able to fetch the value of temp. the variable on declared on the terminal.

The solution I found:-->

You need to add VM arguments for your specific UAT in RCPTT like below
-Dsample=${env_var:Test_User}

After declaring VM arguments you need to call it in your script like below:-->

global [val Test [ substitute-variables "${system_property:sample}"]]
//Above command will fetch the variable from VM argument

You can check it using this command:--> [/b]$Test | show-alert[/b]

BUT as variable declared on terminal using export command is temporary as for limited session only, You need to launch RCPTT from the terminal only and then run your test case it will be able to give the value of the variable on the terminal.


THANKS,
MAYUR SANCHETI

Previous Topic:values are not updated in AUT
Next Topic:Unable to Launch AUT from Jenkins using window batch command
Goto Forum:
  


Current Time: Thu Mar 28 20:36:53 GMT 2024

Powered by FUDForum. Page generated in 0.02746 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top