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: Martin Moser <martin.moser@?.de>
  • Date: Fri, 17 Feb 2012 08:41:31 +0100

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