List Icon
Archiv Mailingliste

2019 bis Juli 2022  2018  | 2017 2016 2015 | 2014 | 2013

Die Mailingliste ist seit Juli 2022 geschlossen, dient aber weiterhin als Informationsarchiv zu QF-Test.
Wenn Sie aber über Neuerungen zu QF-Test informiert bleiben wollen, können Sie einfach unseren
Newsletter abonnieren

Um aktuell die Informationen zu jeder Release - auch Minor Releases - zu bekommen, können Sie den
RSS-Feed abonnieren oder uns in sozialen Medien folgen.
Alternativ bietet QF-Test auch selbst eine Versionsinformation an.

Eine weitere Informationsquelle ist unser Blog, in dem es aktuelle Beiträge zu allgemeinen Themen, zur Firma QFS und auch diverse "How-Tos" gibt:
Blog abonnieren


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [QF-Test] How to SET an environment variable in QF-Test procedure that is visible to the SUT?


  • Subject: Re: [QF-Test] How to SET an environment variable in QF-Test procedure that is visible to the SUT?
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Thu, 13 Oct 2016 08:16:59 +0200

Hello Matthias,

looks like you're mixing up environment variables and system
properties.


If your application reads properties via
java.lang.System.getProperty(...), you need to define them via

-Dpropertyname=propertyvalue

as an argument to the Java VM in your startup sequence. Alternatively
you can run an SUT script right after connecting to the SUT with

System.setProperty("propertyname", "propertyvalue")


If the SUT reads environment variables with java.lang.System.getenv(),
you can set them before SUT start in a Server script with

rc.setProperty('env',"propertyname", "propertyvalue")

- as you mentioned.

Best regards,
    Greg

Matthias Scholz <scholz@?.com> writes:

> Hallo,
>
> We have an RCP Client that reads some environment variables on startup
> (using System.getProperty()).
> When running the client outside of QF-Test and setting the variables
> as JVM options, everything works fine.
>
> When testing it with QF-Test, we'd also need to set some of these
> variables before starting the client.
> We tried setting them using
>
> rc.setProperty('env',<property name>, <property value>)
>
> in a QF-Test server script before starting the SUT client.
>
> However, when the client reads these properties then, they are always
> unset (i.e. their value is null).  :(
>
> So what is the correct way to achieve that in QF-Test?
>
> Best,
>   MP
> _______________________________________________
> qftest-list mailing list
> qftest-list@?.de
> https://archive.qfs.de/mailman/listinfo/qftest-list

--
Gregor Schmid

E: gregor.schmid@?.de
T: +49 8171 38648-11
F: +49 8171 38648-16

Quality First Software GmbH | www.qfs.de
Tulpenstr. 41 | 82538 Geretsried | Germany
GF Gregor Schmid, Dr. Martina Schmid, Karlheinz Kellerer
HRB München 140833