Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Check multi-line text block
Check multi-line text block [message #715862] Mon, 15 August 2011 19:43 Go to next message
karmatic  is currently offline karmatic Friend
Messages: 11
Registered: August 2011
Junior Member
I want to validate/check a text field with multiple lines of text.

example

Beispielstrasse 7
12345 Neverland


How can check if the content of both lines are correct using Jubula? If I write the whole address in a single line it gives an error.

Important! The address is a one text block with line breaks.
Re: Check multi-line text block [message #715961 is a reply to message #715862] Tue, 16 August 2011 06:09 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hello,

Using regular expressions to check the data will let you do this:
http://help.eclipse.org/indigo/topic/org.eclipse.jubula.client.ua.help/html/reference/node4.html

Best regards,
Alex
Re: Check multi-line text block [message #716011 is a reply to message #715961] Tue, 16 August 2011 08:17 Go to previous messageGo to next message
karmatic  is currently offline karmatic Friend
Messages: 11
Registered: August 2011
Junior Member
Alex Schladebeck wrote on Tue, 16 August 2011 02:09
Hello,

Using regular expressions to check the data will let you do this:
Link

Best regards,
Alex


@Alex
Thank you for the quick reply. In fact I have visited the exact link before I posted my problem. As far as I understand in Parameter value I should enter,
'Beispielstrasse 7\$12345 Neverland'

But when I run the test it wouldn't recognize the regexp.
I also tried the following Parameter values.
'Beispielstrasse 7\n12345 Neverland'

Beispielstrasse 7\\n12345 Neverland


Re: Check multi-line text block [message #716021 is a reply to message #716011] Tue, 16 August 2011 08:32 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi,

The version with the two backslashes:
Beispielstrasse 7\\n12345 Neverland


works for me.

Are you using the operator "matches" for the check?

If you're still having problems with the line break, then you could use .* instead as a workaround.

Best regards,
Alex
Re: Check multi-line text block [message #716034 is a reply to message #716021] Tue, 16 August 2011 09:02 Go to previous messageGo to next message
karmatic  is currently offline karmatic Friend
Messages: 11
Registered: August 2011
Junior Member
Alex Schladebeck wrote on Tue, 16 August 2011 04:32
Hi,

The version with the two backslashes:
Beispielstrasse 7\\n12345 Neverland


works for me.

Are you using the operator "matches" for the check?

If you're still having problems with the line break, then you could use .* instead as a workaround.

Best regards,
Alex


Hmm.. I tried your last suggestion as well.
As you can see on the attachment, it still doesn't work. I have no idea what else I can do.

Thanks again for the quick response.

index.php/fa/3663/0/
  • Attachment: regexp.png
    (Size: 34.08KB, Downloaded 831 times)

[Updated on: Tue, 16 August 2011 09:02]

Report message to a moderator

Re: Check multi-line text block [message #716051 is a reply to message #716034] Tue, 16 August 2011 10:28 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
It looks like you're using backslash in front of the .* for the regex - that's not necessary. If you take away the backslash it should work.
Re: Check multi-line text block [message #716055 is a reply to message #716051] Tue, 16 August 2011 10:56 Go to previous messageGo to next message
karmatic  is currently offline karmatic Friend
Messages: 11
Registered: August 2011
Junior Member
Well, I tried that too. Sad

index.php/fa/3664/0/
  • Attachment: regexp2.png
    (Size: 34.23KB, Downloaded 838 times)

[Updated on: Tue, 16 August 2011 10:56]

Report message to a moderator

Re: Check multi-line text block [message #716069 is a reply to message #716055] Tue, 16 August 2011 12:00 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
It may be the case that you need to place .* after each item as well.

Max Mustermann.*Keplerstr. 10.*22765 Hamburg.*


or

Max Mustermann.*\\nKeplerstr. 10.*\\n22765 Hamburg.*


both give me correct matches in a test I did here.

[Updated on: Tue, 16 August 2011 12:00]

Report message to a moderator

Re: Check multi-line text block [message #716117 is a reply to message #716069] Tue, 16 August 2011 13:39 Go to previous message
karmatic  is currently offline karmatic Friend
Messages: 11
Registered: August 2011
Junior Member
Thank you very much for being so patient. The last suggestion did work.

Max Mustermann.*\\nKeplerstr. 10.*\\n22765 Hamburg.*
Previous Topic:Upcoming training courses at BREDEX
Next Topic:tests case to log in
Goto Forum:
  


Current Time: Tue Apr 23 17:27:01 GMT 2024

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

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

Back to the top