Does not match the specific value (foreground/background)

Ask general questions here.
wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

Does not match the specific value (foreground/background)

Post by wlijo » Mon Aug 24, 2015 9:10 pm

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.-

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Aug 25, 2015 9:05 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

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

Post by wlijo » Tue Aug 25, 2015 1:23 pm

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.-
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Aug 25, 2015 1:59 pm

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?
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Tue Aug 25, 2015 2:54 pm

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?
Shortcuts usually aren't...

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Aug 25, 2015 3:03 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

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

Post by wlijo » Tue Aug 25, 2015 3:09 pm

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!

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Tue Aug 25, 2015 3:20 pm

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.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Tue Aug 25, 2015 9:26 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Aug 26, 2015 9:21 am

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? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Wed Aug 26, 2015 3:33 pm

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...
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri Aug 28, 2015 7:53 am

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

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Fri Aug 28, 2015 5:33 pm

Roger that! Thanks Alex, shouldn't cause problems for me.
Shortcuts usually aren't...

wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

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

Post by wlijo » Wed Sep 23, 2015 1:40 pm

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).
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Sep 23, 2015 2:10 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration