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 über Neuerungen zu QF-Test informiert bleiben wollen, können Sie einfach unseren Newsletter abonnieren:
Newsletter abonnieren


[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: "Zhao, Tom" <tom.zhao@?.com>
  • Date: Sun, 8 Apr 2018 02:45:29 +0000
  • Delivered-to: qftest-list@?.net
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myadvantest.onmicrosoft.com; s=selector1-ADVANTEST-COM; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=auiKuZZMrF54LXHLWsAk5jviATuwJVFSZE94Pr1uDLk=; b=eOzaFybScPf/vbelrk7r2LefJ4mXPu8//jRXA4iJqBm8VxbrzVXlWiUvXVODF1PHJqcZt8WMIq//92udOfpE9TY2cFoWsv8x7QKdTJa6OPuNW/V9kuqFFBJrlHE8RZoKMgUaJNj4CwGFr8rkjVAtqLB/v40BVaPPa/YgypvOyIg=
  • Spamdiagnosticmetadata: NSPM
  • 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
> 
> Advantest (China) Co., Ltd.
> 
> Tel:021-6163-0093 <tel:021-6163-0093>
> 
> Fax:021-2028-7601
> 
> Email:tom.zhao@xxxxxxxxxxxxxxxx
> 
> Add: C Block, Bldg.3, 168 HuaTuo Road,
> 
> 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