I am experimenting with the R port of Selenium, namely the recently released Relenium. Locating web elements on the page using Relenium seems straightforward enough so far. However, I am having difficulty selecting and deselecting checkboxes. Given the following code I would expect some change in the state of the checkbox on the web page:
library(relenium)
firefox <- firefoxClass$new()
firefox$get("http://jamaserv.jama.or.jp/newdb/eng/prod4/prod4TsMkEntry.html")
firefox$printHtml()
chkbox <- firefox$findElementByXPath("//input[@name='chkCarMaker4All'][@type='checkbox']")
chkbox$isSelected()
chkbox$click()
chkbox$isSelected()
What I get is this, which suggests that no change in state has been achieved:
chkbox$isSelected() # query checkbox state
[1] TRUE
> chkbox$click() # to deselect box
> chkbox$isSelected()
[1] TRUE # no change in state?
>
I have looked at questions related to using Selenium in other languages such as this one for Java but haven't applied them to my own case with any success. This is the first time I have used Selenium, so it may be that I am missing something obvious in its Relenium variant. Any pointers on how to select/deselect checkboxes would be appreciated.