Trouble changing the state of an infragistics checkbox
Posted: Mon Jul 26, 2010 7:03 pm
I am trying to change the state of my checkbox from unchecked to checked...Note that this is not a regular checkbox but it is a checkbox in an infragistics treeview where every node is a checkbox. Note that RanorexSpy recognizes this as a checkbox though....
Below is how I try to do it. I have tried two ways to do it and both of them return an error:
Technique 1:
Ranorex.CheckBox mycheckbox= repo.FormMain.CatalogForm.CheckBoxFW02218GBNN;
if (!mycheckbox.Checked) mycheckbox.Checked = true
Technique 2
Ranorex.CheckBox mycheckbox= repo.FormMain.CatalogForm.CheckBoxFW02218GBNN;
Accessible accItem= new Accessible(mycheckbox);
accItem.DoDefaultAction();
Below is the error I get:
Ranorex.SetAttributeFailedException: Setting attribute 'checked' failed on element '{CheckBox:FW02218GBNN}'. ---> Ranorex.RanorexException: Could not set CheckState to 'Checked' by performing default action.
at Ranorex.Plugin.MsaaFlavorElement.SetAttributeValue(Element element, String name, Object value)
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
--- End of inner exception stack trace ---
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
at Ranorex.CheckBox.set_Checked(Boolean value)
Any help is appreciated
Below is how I try to do it. I have tried two ways to do it and both of them return an error:
Technique 1:
Ranorex.CheckBox mycheckbox= repo.FormMain.CatalogForm.CheckBoxFW02218GBNN;
if (!mycheckbox.Checked) mycheckbox.Checked = true
Technique 2
Ranorex.CheckBox mycheckbox= repo.FormMain.CatalogForm.CheckBoxFW02218GBNN;
Accessible accItem= new Accessible(mycheckbox);
accItem.DoDefaultAction();
Below is the error I get:
Ranorex.SetAttributeFailedException: Setting attribute 'checked' failed on element '{CheckBox:FW02218GBNN}'. ---> Ranorex.RanorexException: Could not set CheckState to 'Checked' by performing default action.
at Ranorex.Plugin.MsaaFlavorElement.SetAttributeValue(Element element, String name, Object value)
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
--- End of inner exception stack trace ---
at Ranorex.Core.Element.SetAttributeValue(String name, Object value)
at Ranorex.CheckBox.set_Checked(Boolean value)
Any help is appreciated