Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Verification of text with regexp special symbols in edit boxes
Verification of text with regexp special symbols in edit boxes [message #1004144] Tue, 22 January 2013 16:50 Go to next message
Dmitriy T is currently offline Dmitriy T
Messages: 11
Registered: December 2012
Junior Member
Hi,
Let's some text entered in edit box has a special symbols like '{', '}', '[', ']' etc.
If I try to verify is the text was entered correctly using 'ub_ctx_checkText' keyword with identical text in 'text' option and 'matches' operator, verification fails.
The same result appears when I saves the text into any variable and use 'ub_app_checkStringValues' with 'matches' operator, because interpreter accepts braces as regular expression special symbols.
Using the 'equals' operator isn't a good idea because keyword is planned to use for text comparison with the templates with regular expressions.

The first idea was to store the edit box content into string variable and replace the '{', '}' symbols with '\{', '\}' but I cannot find how to make the replacement.
Has the Jubula any tools for replace the symbols in variables or to compare strings which contain braces or other special symbols?
Re: Verification of text with regexp special symbols in edit boxes [message #1004391 is a reply to message #1004144] Wed, 23 January 2013 06:03 Go to previous messageGo to next message
Yashveer Rana is currently offline Yashveer Rana
Messages: 15
Registered: November 2012
Junior Member
You need to use two backslashes to escape the regular expression special characters.
i.e.

For checking '{ab}', you will need to use the regular expression :

'\\{ab\\}'

Reference:

Using Simple Match for Text Verification
Re: Verification of text with regexp special symbols in edit boxes [message #1005060 is a reply to message #1004391] Thu, 24 January 2013 11:55 Go to previous messageGo to next message
Dmitriy T is currently offline Dmitriy T
Messages: 11
Registered: December 2012
Junior Member
Yes, It's true, but I need to enter 'clear' data in editbox without auxiliary symbols.
And after that, I need to compare the entered content with original (to verify data).
Re: Verification of text with regexp special symbols in edit boxes [message #1005363 is a reply to message #1005060] Fri, 25 January 2013 05:59 Go to previous message
Yashveer Rana is currently offline Yashveer Rana
Messages: 15
Registered: November 2012
Junior Member
I believe for this case, you can use clear strings ( without escape symbols) by putting the whole expression in single quotes
i.e . for string "{AB.C}"

you can use "'{AB.C}'" since anything within single quotes is treated as is,
Previous Topic:Scheduling - schedule AUT starting, schedule test executing...
Next Topic:Error "Timeout received before confirming the posted event" while testing by remote deskto
Goto Forum:
  


Current Time: Thu Oct 23 22:01:25 GMT 2014

Powered by FUDForum. Page generated in 0.01537 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software