Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Strange behaviour of text assertion
Strange behaviour of text assertion [message #1444624] Tue, 14 October 2014 10:28 Go to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
Hello,
I'm trying to test if my text contains a "Warning" message or no.
In order to get a successfull test I require a text without "Warning" message.
Commands used:
get-property text | contains "WARNING:" | verify-false
or
get-property text | matches "(?s).*WARNING:.*" | verify-false
The both commands are not working correctly for me.
Any help is so welcome Smile
Re: Strange behaviour of text assertion [message #1444644 is a reply to message #1444624] Tue, 14 October 2014 10:51 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hello!

Could you send us considered text.




Yours sincerely,
Olga.
Re: Strange behaviour of text assertion [message #1444651 is a reply to message #1444644] Tue, 14 October 2014 11:02 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
the considered text:
WARNING: invalid board status, it is recommended you check the address and update the status again.
INFO: trace files will be stored on the board filesystem
Re: Strange behaviour of text assertion [message #1444664 is a reply to message #1444651] Tue, 14 October 2014 11:25 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

I expect your tests to be failed with this text. Does your test fail with this text? What does it mean "commands are not working correctly"?

Did you add that verifications by assertion and verification mode while recording? If you did, could you please attach screenshot when you add that verifications.


Yours sincerely,
Olga.

[Updated on: Tue, 14 October 2014 12:01]

Report message to a moderator

Re: Strange behaviour of text assertion [message #1444741 is a reply to message #1444664] Tue, 14 October 2014 13:40 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
Yes, normally it should fail. But it doesn't Sad so it is not working correctly.
Yes I used assertion mode while recording.
A screenshot is attached.
Re: Strange behaviour of text assertion [message #1445203 is a reply to message #1444741] Wed, 15 October 2014 05:40 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Could you please attach Widget Details (how to get it) and Execution Details.

It is possible that message appears in control text after verification is done. Please try adding a long enough delay before assertion. Usually this is not required as RCPTT waits for background jobs to complete before proceeding, but hardware interaction might introduce additional complications.

wait 10000
get-property text | contains "WARNING:" | verify-false


Yours sincerely,
Olga.
Re: Strange behaviour of text assertion [message #1445314 is a reply to message #1445203] Wed, 15 October 2014 09:12 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
Thanks a lot !
It works perfectly !
Re: Strange behaviour of text assertion [message #1446845 is a reply to message #1445314] Fri, 17 October 2014 11:46 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
I'm sorry but the fix doesn't work any more.
Below the details of the execution
*click* time: 0.189 s
*wait 80000* time: 1 m 20 s
*get-window "Configure Session..."* time: 0.008 s
*get-val sessionName* time: 0.000 s
*get-label "Session_1"* time: 0.010 s
*get-editbox -index 2* time: 0.018 s
*get-property -name text* time: 0.002 s
*contains -value "WARNING:"* time: 0.000 s
*verify-false* time: 0.026 s
Re: Strange behaviour of text assertion [message #1446891 is a reply to message #1446845] Fri, 17 October 2014 13:12 Go to previous messageGo to next message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Fix doesn't work because considered text doesn't appear in 80 sec. Is it expected behavior?
If it is, you should add longer delay and ensure that launch timeout is long enough.
Also you can use the following snippet to wait just enough for the text to appear. Please choose enough time and delay for your situation.

try -times 20 -delay 500 -command { get-property text | equals "" | verify-false}
get-property text | contains "WARNING:" | verify-false


If you could attach widget details, it would help us to make cases like this working out of the box without manual delays


Yours sincerely,
Olga.
Re: Strange behaviour of text assertion [message #1448745 is a reply to message #1446891] Mon, 20 October 2014 11:32 Go to previous messageGo to next message
maherzia belaazi is currently offline maherzia belaaziFriend
Messages: 41
Registered: October 2014
Member
I didn't succeed to get correct verification result Sad
While debugging I can see the text warning, but the verification point doesn't return correct result.
Any help is welcome Smile
Widget Details:
Widget information
Class: org.eclipse.swt.custom.StyledText
extends org.eclipse.swt.widgets.Canvas, org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.Scrollable, org.eclipse.swt.widgets.Control, org.eclipse.swt.widgets.Widget
implements org.eclipse.swt.graphics.Drawable

WidgetID: Shell/Shell|-1/Composite|0/Composite|0/Composite|0/Composite|1/StyledText|1
Style flags: 571736138 (NoBackground|NoRedrawResize|DoubleBuffered)
Enabled: true
Focused: false
Visible: true
Reparentable: true
Text value: WARNING: a trace session is already running on the board (id: 0x3ca064d3, name: "Session_1").INFO: trace files will be stored on the board filesystem: /root/Session_1*
Registered event listeners:
listener class: org.eclipse.swt.custom.StyledText$16
implements org.eclipse.swt.widgets.Listener
events:
SWT.FocusIn
listener class: org.eclipse.swt.custom.StyledText$7
implements org.eclipse.swt.widgets.Listener
events:
SWT.KeyDown
SWT.KeyUp
SWT.Traverse
SWT.MouseMove
SWT.MouseDown
SWT.Resize
SWT.MouseUp
SWT.Dispose
SWT.Paint
SWT.MenuDetect
Re: Strange behaviour of text assertion [message #1450457 is a reply to message #1448745] Wed, 22 October 2014 13:18 Go to previous message
Olga Yurchuk is currently offline Olga YurchukFriend
Messages: 245
Registered: September 2014
Senior Member

Hello,

There is a truly bug with property values update. Thank you for finding that.
Could you please attach complete actual snippet so we'll try suggest changes with workaround.


Yours sincerely,
Olga.
Previous Topic:Unable to assert tree/table structure of nebula nettable in AUT unlike jface tables
Next Topic:[SOLVED] How to use relative path from Context Folders
Goto Forum:
  


Current Time: Fri Apr 26 13:40:59 GMT 2024

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

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

Back to the top