I'm trying to test a page containing an element that, when the page is first opened, has its style= attribute set to display: none;
. In Firefox, when the test interacts with the page (two text fields, for now), the button is enabled, and can be clicked programmatically. In IE8, however, the button cannot be clicked if the page has been interacted with by the test, even if I try to manually click it. This is what the code looks like:
<a tabindex="21" onclick="if(!allow_submit() || nextStepLocked()){return false;};; new Ajax.Request(saveInfo); return false;" id="nextStepButton" href="#" class="nextButton" style="display: none;">
<img src="/btn_next_step.png" alt="Btn_next_step">
</a>
<img style="" src="/btn_next_step.png?" id="hiddenNextStepButton" class="nextButton" alt="Btn_next_step">
There's a similar block on the page that leads to this one, and I was able to click it just fine with the code browser.image(:alt => "Btn_next_step").click
. I also noticed that when the image switches from a non-clickable to a clickable state, it moves up a few pixels; if I trigger the clickable state in code, this same movement occurs, but the button does not become clickable.
So far, I have tried using AutoIt to mimic the actions normally taken on the page, and I have also tried many different ways of interacting with the image, such as referencing different indices, using multiple identification methods at once, and so on. I even tried messing around in irb, but to no avail.
Update:
I checked the input fields, and they do indeed respond to onchange events, but only to capitalize the first letter of the text you enter. Since the button seems to work if I do just about anything on the page, I looked through the entire source and found the following at the end of the page:
<script>
document.onkeydown=function(e){
accession_hotkeys(e);
};
</script>
I'm not sure how to properly fire this event, though. Doing it on any specific element doesn't seem to have an effect.