Page 1 of 2

Does not match the specific value (foreground/background)

Posted: Mon Aug 24, 2015 9:10 pm
by wlijo
Hi all,

I've a problem when i check for background or foreground color.
In my recording module I have this

Image in reply

and in the report i have this

Image in reply

I can't understand why in expected said null, and in the step before on the report I have the right information.

I hope someone can help me

Thanks!
Walter.-

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 9:05 am
by odklizec
Hi,

It sounds like a problem with Ranorex, but it's very hard to say something definitive without knowing more about the problematic element (used GUI framework?), Ranorex version, OS version, etc...

Any chance to post Ranorex snapshot of the element in question? Ranorex snapshot would answer most of the above questions. Sample application (if possible) would be extremely helpful too.

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 1:23 pm
by wlijo
Hi,

Thanks for your reply.

I'm adding the snapshot.

Ranorex Version: 5.4.0.24580
OS: Windows 7 Professional 64 bit Service Pack 1

Regards,
Walter.-

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 1:59 pm
by odklizec
Hi,

OK, the snapshot helped. The reason why you are getting 'null' is that the Foreground attribute is definitely empty (Background too)...
foreground_null.png
So the only problem I see in the Validation error message, which somehow mixed Expected and Actual strings ;) Basically, they should be reversed. Expected (validated) valued is java.awt.Color[r=255,g=0,b=0] but actual value is "null".
This is probably a bug in Ranorex?

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 2:54 pm
by krstcs
When I looked at it, they were not 'null', they were '[Java Object]' with no extra data.

Pavel, do you have Java installed on your system? What version?

I do think the order of operands is reversed in the report, which is a Ranorex BUG.



Walter, what version of Java are you using?

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 3:03 pm
by odklizec
Hi Kelly,

I have Java 8 update 51 installed (just runtime, no SDK). Not the latest one, but I guess this should not be a reason of "null" content? I will update Java tomorrow and see if there is any difference.

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 3:09 pm
by wlijo
krstcs wrote:When I looked at it, they were not 'null', they were '[Java Object]' with no extra data.

Walter, what version of Java are you using?
Hi Kelly this is the information about java

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Regards!

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 3:20 pm
by krstcs
Hmm...

My guess is that this is a regression in 5.4. I'm running 5.3.2 (yes, I know I need to update... I'm waiting for 5.4.1... :D) and I can see at least that it's a [Java Object].

So, my guess is that this is caused by a combination of factors, including a possible regression introduced in 5.4.0. I still don't see any color values (rgb) in the object either.

Re: Does not match the specific value (foreground/background)

Posted: Tue Aug 25, 2015 9:26 pm
by Support Team
Hi everybody,

krstcs is right, I can confirm that the Validate.AttributeEqual behavior with complex Java objects is a regression in 5.4.0. AFAIK from a brief investigation, this was caused by a bad reintegration of the JavaFX feature branch :(

I'll added a high severity bug to our bug tracking, so the bug fix will definitely be fixed with our next service release (but cannot make it into 5.4.1 any more, since it was already released today).
krstcs wrote: I still don't see any color values (rgb) in the object either.
Is this a separate issue? Can you explain it in more detail?
krstcs wrote:I do think the order of operands is reversed in the report, which is a Ranorex BUG.
It's not the order of the operands, it's the conversion from the expected string value "java.awt.Color..." which returns "null", causing the validation with the actually not-null Java object to fail.

Regards,
Alex
Ranorex Team

Re: Does not match the specific value (foreground/background)

Posted: Wed Aug 26, 2015 9:21 am
by odklizec
Support Team wrote:
krstcs wrote:I do think the order of operands is reversed in the report, which is a Ranorex BUG.
It's not the order of the operands, it's the conversion from the expected string value "java.awt.Color..." which returns "null", causing the validation with the actually not-null Java object to fail.
Hi Alex,

Are you sure about this? So you mean that the expected string used in Validate action (see screenshot in second wlijo's post) is during validation automatically converted to rgb value? Then why it's returned as null? Because of the mentioned regression?

And even better, if the error message (posted by wlijo) is correct, then it seems as if Ranorex was somehow able to obtain the actual Foreground value from the pointed element. But if you check the snapshot, Foreground attribute is empty! So it does not make sense? ;)

Re: Does not match the specific value (foreground/background)

Posted: Wed Aug 26, 2015 3:33 pm
by krstcs
All I see in the Snapshot is '[Java Object]', I don't see any rgb values in either Foreground or Background.


Since all I test is Java desktop apps with Ranorex, is this bug going to cause any other issues if I update to 5.4.1? I'm not sure I want to upgrade now, if it's going to kill all of my tests and validations. I guess I'll try on my box and see if it breaks anything...

Re: Does not match the specific value (foreground/background)

Posted: Fri Aug 28, 2015 7:53 am
by Support Team
odklizec wrote:Are you sure about this?
Yes :D
The problem is the conversion of complex Java objects to strings and vice versa. The initial implementation, which was re-introduced by the bad merge (regression), just did not provide a real conversion to string, but simply returned null. Consequently, snapshots, which rely on string conversion (serialization), do not contain useful information.
krstcs wrote:this bug going to cause any other issues if I update to 5.4.1?
This will cause problems when you have validation actions or do validations (using the Ranorex.Validate class) on attributes delivering complex Java types. Only dynamic attributes deliver complex Java types, so all "standard" attributes should work fine.

Regards,
Alex
Ranorex Team

Re: Does not match the specific value (foreground/background)

Posted: Fri Aug 28, 2015 5:33 pm
by krstcs
Roger that! Thanks Alex, shouldn't cause problems for me.

Re: Does not match the specific value (foreground/background)

Posted: Wed Sep 23, 2015 1:40 pm
by wlijo
Hi Alex,

I'd like to know if this problem is fixed in the release 5.4.2 (now available), on the other hand I have another problem when I want to use RowCount I need to write the command(I'm able to because I know it) because it doesn't show, if i write the command works properly, the real problem is that maybe I'm losing different validations those doesn't appear, I'm adding the snapshot.
Support Team wrote:
I can confirm that the Validate.AttributeEqual behavior with complex Java objects is a regression in 5.4.0. AFAIK from a brief investigation, this was caused by a bad reintegration of the JavaFX feature branch :(

I'll added a high severity bug to our bug tracking, so the bug fix will definitely be fixed with our next service release (but cannot make it into 5.4.1 any more, since it was already released today).

Re: Does not match the specific value (foreground/background)

Posted: Wed Sep 23, 2015 2:10 pm
by odklizec
Hi,

As for the first problem, reading Java attributes should be fixed in 5.4.2, but it's hard to say about your particular issue. Have you tried it?

As for your second problem, I'm not quite sure I understand what's your issue? Could you be more specific about what exactly you want to do? But please, create a new topic about it. Asking something completely unrelated to the initial post (in the same topic) is not a very good habit ;) Thanks.