0

I am creating a Ranorex Checkbox object and then grabbing the appropriate checkbox using Ranorexpath. But I am unable to check this checkbox using the CheckBox.Check() event. On the UI, a tick mark appears on the checkbox but in reality the checkbox remains unchecked and as a result the expected messages do not appear on the screen and the test fails. Please let me know what I am doing wrong. Code snipped below:

                if(value=="99283" || value =="99281")
                {
                    Ranorex.CheckBox EMlevelReason="/dom[@domain='"+domain+"']//object[#'slApp']/form/form[1]/form/list[@automationid='lstOuter']/listitem[4]/list/listitem[4]/checkbox[@name='Single xray']";                      
                    EMlevelReason.Focus();                     
                    if(EMlevelReason.Checked!=true)
                    {
                        EMlevelReason.Focus();
                        EMlevelReason.Check();  // doesn't work. the checkbox appears checked on the UI but actually remains unchecked                  
                    }
                }
3
  • What does your code look like..? also have you checked the Ranorex website for code samples and examples..?ranorex.com/search.html?q=Ranorex+Checkbox the second link will help you more perhaps ranorex.com/support/user-guide-20/ranorexpath.html
    – MethodMan
    Jan 2, 2013 at 6:58
  • @DJKRAZE I have got the ranorexpath right... Like I mentioned it able to focus on the checkbox. But is unable to check it.
    – RSK
    Jan 2, 2013 at 8:33
  • Perhaps you should post the code method or event where the code resides where you are checking the State of the CheckBox..
    – MethodMan
    Jan 2, 2013 at 9:37

2 Answers 2

0

Why do you think that it was not checked even though it was shown as checked? It sounds like a script is normally executed when the checkbox is checked, if so you could try the following code:

Mouse.Click(EMlevelReason);
0

We were able to develop a workaround for this. We used the click() event instead of check() i.e. in the above code we just replaced EMlevelReason.Check() with EMlevelReason.Click() Don't know why but it works now :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.