Page 2 of 2

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

Posted: Fri Jan 20, 2017 12:02 pm
by bk_tester
Hi All,

I'm using the latest Ranorex (6.2.0) and looks like that bug with retrieving attribute value from complex JavaFX controls still have some issue.

There is custom checkbox in in my SUT, so Checked attribute doesn't represent control state correctly. In the same time, this control has CheckState attribute. Here is workaround how this attribute can be correctly retrieved:

Code: Select all

checkboxAdapter.Element.GetAttributeValue("CheckState"); // gets correct value
checkboxAdapter.GetAttributeValue<string>("CheckState"); // gets null
Hope this would be helpful for someone.

Regards

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

Posted: Fri Jan 20, 2017 12:14 pm
by odklizec
Hi,

Could you please upload a Ranorex snapshot (not screenshot) of the problematic element? Ideally, post a working sample (code), where we can see the issue.

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

Posted: Fri Jan 20, 2017 12:35 pm
by bk_tester
Currently I'm working on PoC using Ranorex. Therefore I am not allowed to post SUT snapshot. If decision makers will approve the automation with Ranorex I will get back to this topic.

Regards

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

Posted: Fri Jan 20, 2017 12:44 pm
by odklizec
In this case, you might try to contact Ranorex guys and [email protected] and request a remote session with them, so they can see the issue and suggest a possible way to overcome it. There is unfortunately nothing anyone here can do without more details (and seeing your AUT).

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

Posted: Sat Jan 21, 2017 5:57 pm
by Support Team
I don't think this is a problem in Ranorex, IMHO the code is just using the wrong return type. CheckBox.CheckState does not return a string, but a value of type Checkstate. IMHO the correct code should look like this:
checkboxAdapter.GetAttributeValue<System.Windows.Forms.CheckState>("CheckState");
// or even easier
var value = checkboxAdapter.CheckState;
Regards,
Alex
Ranorex Team