Selenium, what a great tool
Whilst trying to write some code which would rollover Blackboard courses automatically, year in year out.
We where looking for an answer to using a ‘value’ or piece of ‘text’ which was next to a checkbox rather than the ‘id’ (which is the usual way Selenium handles checkboxes), as the ‘id’ in our case was being dynamically generated so it couldn’t be relied upon being the same number, as it depended how many checkboxes where on that particular screen.
Here’s how we solved it :
where ‘users’ is the value from within the code, rather than ‘Users’ which is just some text after the checkbox, which display next to it, so not really that connected, actual code from within Blackboard (yuck) follows :
<input type='checkbox' name='area' id="area_14" value="users"> <label for="area_14"><font class="fnt0"><b>Users</b></font>
* Note, this only seems to work with Selenium using Firefox 3 as the browser rather than IE.