Skip to content

Instantly share code, notes, and snippets.

@medwards
Created January 16, 2013 14:35
Show Gist options
  • Save medwards/4547510 to your computer and use it in GitHub Desktop.
Save medwards/4547510 to your computer and use it in GitHub Desktop.
Selenium is_displayed defect reproduction: Launch the browser and page, after two seconds the 'Loading' message should be replaced by a 'Ready!' message, then: browser.find_element_by_id('loading_status').is_displayed()
<html>
<body>
<div id="ready_status" style="display: none">
Ready!
</div>
<div id="loading_status" style="overflow: hidden">
Loading....
</div>
<div id="something" style="display: none"></div>
<script type="text/javascript">
function triggerMe() {
document.getElementById("loading_status").style.width = 0;
document.getElementById("loading_status").style.height = 0;
document.getElementById("ready_status").style.display = 'block';
}
window.setTimeout(triggerMe, 2000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment