2018 up to now | 2017 | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

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

Mailing List - Entries of 2014


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

Re: [QF-Test] How To Manipulate A String?


  • Subject: Re: [QF-Test] How To Manipulate A String?
  • From: GAUTHIER Denis <Denis.Gauthier@?.au>
  • Date: Tue, 7 Jan 2014 09:59:07 +1100

[@@ OPEN @@]

Hi Adesh,

 

The easiest way would be to use a ‘Check Text’ node instead of a ‘Fetch Text’.

In the ‘Check Text’ node, use the same Client and Component id as the ones you used in your ‘Fetch Text’ node.

In the Text field, enter something like:

.*YYYY

With YYYY substituted by the value you want (it can be a variable in the $(…) syntax)

Do not forget to tick the ‘As regexp’ button.

 

You can use a more elaborate regexp if you want, the above example corresponds to a endswith() test.

 

Now if you want to stick to your ‘Fetch Text’ node, right after this node insert a ‘Server Script’ node and insert the following script:

 

text = rc.getStr(“variable_to_check”)    # replace with the name of the variable you used in the ‘Fetch Text’ node

if text.endswith(“YYYY”):                            # Replace with the actual YYYY value you want to check against

                rc.logError(“The year is not correct”)

else:

                rc.logMessage(“The year is correct”)

 

 

Hope this helps,

Cheers,

Denis GAUTHIER

This message contains OPEN information that is not sensitive and can be freely accessed by people both inside and outside of the Thales Group

This email was classified by GAUTHIER Denis on Tuesday, 7 January 2014 9:59:07 AM

------------------------------------------------------------------------- DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -------------------------------------------------------------------------