Forum Discussion

Mario87's avatar
Mario87
New Contributor
6 years ago
Solved

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 visible on the page. Does anyone have any idea how to solve? I use version 12 with Vbscript

'Set obj = page.EvaluateXPath("//div[@id='register-step-2']/fieldset[6]/div/label") not work

'Set obj= page.FindChildByXPath("//*[@id='news']/self::input[@type='checkbox']")not work

Help

 

  • Mario87's avatar
    Mario87
    6 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

  • 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

     

     

7 Replies