List Icon

2019 bis heute  2018  | 2017 2016 2015 | 2014 | 2013

[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.



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 (赵心卓)



Advantest (China) Co., Ltd.

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



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

Zhangjiang Hi-Tech Park, Shanghai, China, 201203

qftest-list mailing list

Yann Felix Spöri

E: yann.spoeri@?.de
T: +49 8171 38648-21
F: +49 8171 38648-16

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