Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] I cannot store result of the command to variable
[SOLVED] I cannot store result of the command to variable [message #1440470] Wed, 08 October 2014 08:01 Go to next message
Eclipse UserFriend
I have the following code:

let
[val t1 [get-item "MGW" | get-property "caption" | equals "MGW"]]
[val t2 [get-item "MGW" | get-property "selected" | equals "true"]]
[val t3 [get-item "MGW" | get-property "image.path" | equals "test"]]
{
and [$t1][$t2][$t3]|verify-true
}

It does not work. Error:
Expected Boolean-convertible argument but got class org.eclipse.rcptt.tesla.ecl.model.impl.VerifyHandlerImpl

It works separately like: $t1 | verify-true

looks like the variables are not set to boolean, but definition of "equals" says it returns true or false. I want my test to contain 3 verifications and at the end fail the test if at least 1 verification failed.
Please help me to adjust my code.
thanks!

[Updated on: Wed, 30 September 2015 02:27] by Moderator

Re: I cannot store result of the command to variable [message #1440482 is a reply to message #1440470] Wed, 08 October 2014 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

your problem, rcptt create VerifyHandler in t1, t2, t3. VerifyHandler isn't boolean.
You would same error with :
get-item "MGW" | get-property "caption" | equals "MGW" | bool  


With boolean it's good:
let [val test "test"] {
	let 
	[val t1 [$test | equals "test"]] 
	[val t2 [$test | equals "test"]] 
	[val t3 [$test | equals ""]] 
	{
	    and [$t1][$t2][$t3] | verify-true
	}
}


How convert a verifyHandler in boolean...I don't know (just use "| verify-true" every variable).

Can you test with this code?
and [$t1][$t2][$t3] | foreach { verify-true }

[Updated on: Wed, 08 October 2014 08:41] by Moderator

Re: I cannot store result of the command to variable [message #1440505 is a reply to message #1440482] Wed, 08 October 2014 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Victoriia,

By historical reasons, get-property command returns a special internal object VerifyHandler, which is later populated by commands like equals/matches/contains and processed by verify-true command (hence we can produce error messages more descriptive than 'expected true, but got false').

In order to get an actual property value, a '-raw' key can be used.

let 
[val t1 [get-item "MGW" | get-property "caption" -raw | equals "MGW"]] 
[val t2 [get-item "MGW" | get-property "selected" -raw | equals "true"]] 
[val t3 [get-item "MGW" | get-property "image.path" -raw | equals "test"]] 
{
and [$t1][$t2][$t3]|verify-true
}
Re: I cannot store result of the command to variable [message #1441823 is a reply to message #1440505] Fri, 10 October 2014 04:30 Go to previous messageGo to next message
Eclipse UserFriend
with -raw it works! Thank you Smile
Re: I cannot store result of the command to variable [message #1444051 is a reply to message #1441823] Mon, 13 October 2014 11:17 Go to previous message
Eclipse UserFriend
Here's an extra information about get-property -raw vs just get-property https://www.eclipse.org/rcptt/documentation/faq/get-property-raw/
Previous Topic:[SOLVED] How can i exit proc before its end?
Next Topic:[SOLVED] rcptt strange lags
Goto Forum:
  


Current Time: Sun Jul 06 11:27:16 EDT 2025

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

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

Back to the top