2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012

Mailing List - Entries of 2012


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

Re: [QF-Test] can I use regular experession directly in a If condition


  • Subject: Re: [QF-Test] can I use regular experession directly in a If condition
  • From: "Brian Cohen" <Brian.Cohen@?.com>
  • Date: Fri, 17 Feb 2012 06:02:37 -0500

Thanks Martin. 
So steps below applies to any Jython object.method you want to access outside the Jython Server Script:
   - import required module if necessary
   - declare a global variable
    - set the variable ( in this case, the Jython object)
   - then use Jython methods on that global variable ( which actually is a Jython object) in Qftest nodes by enclosing in $[]
 
Am I understanding this correctly?
-Brian


On Feb 17, 2012, at 2:42 AM, "Martin Moser" <martin.moser@?.de> wrote:

> Hi Brian,
> 
> you can use re.match in If-nodes of QF-Test if you do following:
> 
> 1.) all a Jython-Server-Script, setting the re-module globally.
> 
> Code:
> 
> import re
> global re
> re=re
> 
> 2.)
> After calling this script once you can use the re syntax in a If-node like this:
> 
> $[re.match(".*","a") == None]
> 
> 
> The first script could be called once in your Setup node and then you are free to use it.
> 
> It's now up to you, whether you think this is a good way to go for or whether you prefer inserting a pure script node.
> 
> Best Regards,
> Martin
> 
> --On Mittwoch, Februar 15, 2012 16:37:21 -0500 Brian Cohen <Brian.Cohen@?.com> wrote:
> 
>> Wondering if I can do this, or do I have to insert a  Jython Server/SUT
>> node using the "re" module.
>> 
>> 
>> -Brian
>> 
>> 
> 
> 
> 
> -- 
> Martin Moser                           martin.moser@?.de
> Quality First Software GmbH            http://www.qfs.de
> Tulpenstr. 41                          Tel: +49 8171 38648-14
> DE-82538 Geretsried                    Fax: +49 8171 38648-16
> GF: Gregor Schmid, Karlheinz Kellerer  HRB München 14083