I am aware of the 'Set Value' function which can be used to set the value of a check box to True or False. I have used this in some of my test scripts.
Because of the way that this webpage works it is necessary to actually click on a check box in order to trigger an information window to appear (this does not happen when simply changing the status).
If the status of a check box was checked and I set the value to false and then click on the check box - The page does not behave in the correct way as it never really registered that the check box was false (only the attribute was changed)
This means that to achieve the desired results I must be able to validate whether a check box is checked and depending on this then perform the appropriate actions. Using an If Statement in C# ideally.
I am struggling to find the best way to do this. When I have tried I get errors because boolean cannot be changed to string and visa versa etc. I found the following code example in the user guide. but am not sure exactly how to use this with my ranorex path elements
If someone could provide me with the simplest way to do an IF statement that will actually be able to tell if an element is checked that would be brilliant.// Search for checkbox within .NET application
CheckBox checkBox = "/form[@controlname='TestedApp']
/checkbox[@controlname='checkBox1']";
// Read the current state of a checkbox
Console.WriteLine(checkBox.Text + " State: " +checkBox.CheckState.ToString());
// Check if the checkbox is not checked
if (!checkBox.Checked)
checkBox.Checked = true;
Thanks you VERY much
Ben