2017 | | 2015 | 2014 | 2013 | 2012 | | 2010 | | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries from 2018 up to now

# Re: [QF-Test] About qftest suit dir

• Subject: Re: [QF-Test] About qftest suit dir
• From: "Zhao, Tom" <tom.zhao@?.com>
• Date: Sun, 8 Apr 2018 02:45:29 +0000
• Delivered-to: qftest-list@?.net
• Spamdiagnosticoutput: 1:99

```Hi Yann,

Thanks for your help! Now I can get the suite name by :
rc.getContext().getRunLog().getRoot().getSuitePath()

Another question, I can not find these things from manual, such as, getContext(), getRoot(), getSuitePaht(), ScrollOffsetResolver interface... Is there any new reference I can study?

Best regards,
Tom Zhao (赵心卓)

-----Original Message-----
From: Yann Spoeri, QFS [mailto:yann.spoeri@xxxxxx]
Sent: Wednesday, April 04, 2018 9:01 PM
To: qftest-list@xxxxxx
Cc: Zhao, Tom <tom.zhao@xxxxxxxxxxxxx>
Subject: Re: [QF-Test] About qftest suit dir

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
>
>
> Tel:021-6163-0093 <tel:021-6163-0093>
>
> Fax:021-2028-7601
>
> Email:tom.zhao@xxxxxxxxxxxxxxxx
>
>
> Zhangjiang Hi-Tech Park, Shanghai, China, 201203
>
>
>
> _______________________________________________
> qftest-list mailing list
> qftest-list@xxxxxxxxxxxxxxx
> https://movement.qfs.de/mailman/listinfo/qftest-list
>

--
Yann Felix Spöri

E: yann.spoeri@xxxxxx
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
```