Forum Discussion

Mario87's avatar
Mario87
New Contributor
7 years ago

Invisible Checkbox, can't select

I need select one of this checkbox,but as you can see from the picture when I try to select the checbox, the whole text box is selected. I tried with xpath, but keep telling me that the object is not...
  • Mario87's avatar
    Mario87
    7 years ago

    Solved, i use browser native metod: NativeFirefoxObject. If an element was hidden, use this metod, click on object->work with Object Through Property-> select your browser. it works fine

  • AlexKaras's avatar
    AlexKaras
    7 years ago

    Mario87:

    Hi,

     

    Good to hear that you solved the problem.

    Alternative approach that may work as well is to set the input focus to the target control and send it keyboard keys sequence that executes required task.

    Sample pseudo-code for your case:

    Set chbox = page.someContainer.FindChild("id", "firstcheckbox", 10)

    If (chbox.Exists) Then

      chbox.SetFocus() ' sets input focus

      chbox.Keys(" ") ' presses Space key. This should switch check-box state

    Else

      ' some actions

    End If