<div class="hidden" id="foo">
Ich bin unsichtbar.
</div>
<div id="foo">
Hallo Robot
</div>
Lösung: xpath=//div[@id="foo"][2]
oder besser xpath=//div[@id="foo" and contains(text(), "Robot")]
<!-- Modal HTML embedded directly into document -->
<div id="ex1" class="modal">
<p>Thanks for clicking. That felt good.</p>
<a href="#" rel="modal:close">Close</a>
</div>
<!-- Link to open the modal -->
<p><a href="#ex1" rel="modal:open">Open Modal</a></p>
<button type="button" id="clickme">Click me!</button>
Test Overlay Element | FAIL | WebDriverException: Message: unknown error: Element ... is not clickable at point (43, 123). Other element would receive the click:
...
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.15063 x86_64)
Lösung: Modal schliessen, und Button clicken
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Delay Test</title>
<style>
</style>
<script src="../dist/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function delayedInsert() {
$('#info').append("<span class='msg'>Hallo Robot</span>")
}
$(document).ready(function () {
$('input[type="button"]').bind({
click: function () {
window.setTimeout(delayedInsert, 6000);
}
})
});
</script>
</head>
<body>
<h1>Delay Test</h1>
<input type="button" value="Sag Hallo ..." name="hallo" />
<div id="info"></div>
</body>
</html>
- Lösung 1: Sleep 6
- Lösung 2: Set Selenium Timeout 10
- Lösung 3 (die beste): Wait Until Element is Visible css=.msg