List Icon
Mailing list Archive

2019 up to July 2022 | 20182017  |  2016  2015 2014 | 2013

The mailing list has been closed since July 2022, but continues to serve as an archive of information about QF-Test.
But if you want to stay informed about news about QF-Test, you can simply
Subscribe to Newsletter  

To get up-to-date information about each release - including minor releases - you can
subscribe to the RSS feed or follow us on social media.
Alternatively, QF-Test also provides release information itself.

Another source of information is our blog, where there are current articles on general topics, on the company QFS and also various "how-tos"
subscribe to blog


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

Re: [QF-Test] About qftest suit dir


  • Subject: Re: [QF-Test] About qftest suit dir
  • From: "Yann Spoeri, QFS" <yann.spoeri@?.de>
  • Date: Wed, 4 Apr 2018 15:00:49 +0200
  • Delivered-to: qftest-list@?.net

Hi Tom,

The easiest way to implement this is to use a procedure parameter in order to pass the desired variable:

Suite C:\temp\xxx\SB.qft:

.+ Extras
...+ Procedure call: ../SA.qft+PA
.....Variable definitions: caller=$!{qftest:suite.path}

Suite C:\temp\SA.qft:

.+ Procedures
...+ Procedure PA
.....Parameter: caller=None
.....+ Jython Server Script
print rc.lookup("qftest", "suite.path") # will print C:\temp\SA.qft
print rc.lookup("caller") # will print C:\temp\xxx\SB.qft

If you don't want to add a procedure parameter, things become more complicated. For example it is possible to write a testrunlistener [1], which
tracks the changes in the qftest:suite.path group or you can also access the desired information via the run-log [2]. Something like

# get the last node in the run-log
# which will return the node for the currently executing script
lastNode = rc.getContext().getRunLog().getRoot()
while lastNode.getChildNodeCount() > 0:
    lastNode = lastNode.getChildNode(lastNode.getChildNodeCount() - 1)
# get the parent node which is the procedure node
# at least if this script is directly located below the Procedure: PA
procedurePA = lastNode.getParentNode()
# get the parent of the procedurePA node which is the SuiteChangeLog
# node in the run-log. If there is no SuiteChangeLog Node, the procedure
# was called from the same suite and we could get the current suite path
# via:
#procedureCall = procedurePA.getParentNode()
#print procedureCall.getSuitePath()
suiteChange = procedurePA.getParentNode()
# need to get the parent of the suiteChange node
procedureCall = suiteChange.getParentNode()
print procedureCall.getParentNode().getSuitePath()

will do it.

Greetings,
    Yann

[1] https://www.qfs.de/en/qf-test-manual/lc/manual-en-tech_testrunlisteners.html#sec_testrunlisteners
[2] https://www.qfs.de/en/qf-test-manual/lc/manual-en-user_debugging.html#usec_runlog

Am 03.04.2018 um 10:30 schrieb Zhao, Tom:
Dear All,

In our project, we made a procedure PA to print our ${qftest:suite.path} in suite SA. In suite SB, we call the procedure PA which is in suite
SA.  The result is the path of SA. The question is, how can we get the path of SB by just call procedure in SA?

Best regards,

Tom Zhao (赵心卓)

------------------------------------------------------------

R&D-Department

Advantest (China) Co., Ltd.

Tel:021-6163-0093 <tel:021-6163-0093>

Fax:021-2028-7601

Email:tom.zhao@?.com

Add: C Block, Bldg.3, 168 HuaTuo Road,

Zhangjiang Hi-Tech Park, Shanghai, China, 201203



_______________________________________________
qftest-list mailing list
qftest-list@?.de
https://movement.qfs.de/mailman/listinfo/qftest-list

--
Yann Felix Spöri

E: yann.spoeri@?.de
T: +49 8171 38648-21
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