I'd like to be able to automatically fill in the following test. After each phrase you can choose either Eens (I agree) or Oneens (I don't agree). I'm using RSelenium to do this.
Loading my browser and the first phrase poses no problem at all. However, I can't select either the green or red box. I'm using the following code:
choice_xpath <- "//*[contains(.,'Eens')]"
choice <- driver$findElement(using = "xpath",
choice_xpath)
choice$clickElement()
When I execute the code above NULL is returned. Since no 'element not found' error is returned I guess I'm clicking on an element which exists but can't be clicked upon. But I'm at a loss what element to click on if that's the case.
I think this is the html required to understand the problem:
<script type="text/template" id="statements-tpl"></script>
<script type="text/template" id="statement-tpl">
<span class="prev-button"><span><</span></span>
<div class="copy">
<div class="copy-inner">{{ copy }}</div> </div>
<div class="button-wrap">
<div class="button-container">
<div class="button button-1">
</div>
</div>
<div class="button-container">
<div class="button button-0"></div>
</div>
<div class="button-container no-opinion">
<div class="button button-2"></div>
</div>
</div>
<span class="next-button"><span>></span></span>
</script>
<script type="text/template" id="button-tpl">
<div class="button-inner-wrapper">
<div class="button-inner{{ selected ? ' selected' : '' }}">
<div class="prefix">Jouw antwoord:</div>
<div class="copy"> {{% if ( type == 2 ) { %}} Geen mening {{% } else if ( type == 0 ) { %}} Oneens {{% } else { %}} Eens {{% } %}} </div>
<div class="error-tooltip"></div>
</div>
</div>
</script>