I'm trying to get开发者_开发百科 my old Selenium RC tests to function with Selenium 2.0b2 standalone. I'm using the Selenium python driver and have not gone with the approach of running weddriver and selenium tests side by side with the WebDriverBackSelenium. This maybe the approach but thats a separate question. So I'm faced with a problem of getting Selenium 2 to work with Firefox 3 & 4. Here is a sample of my test:
sel.open("window.html")
sel.click("ff4button")
for i in range(60):
windowname = sel.get_all_window_titles()
print windowname
The only window this ever finds is the parent window in this case called Base window, here is the source of the 2 HTML files
The window.html source is this:
<html>
<head>
<title>Base window</title>
<script type="text/javascript">
function openwindow()
{
window.open("test.html", "testwindow", "width=500,height=500");
}
</script>
</head>
<body>
<h1>Firefox 4 Selenium sample</h1>
<button id="ff4button" onclick="openwindow()">Open new window</button>
</body>
</html>
Which opens test.html:
<html>
<head>
<title>testwindow</title>
</head>
<body>
<h1>New Window</h1>
</body>
</html>
Anyone have ideas on why this isn't seeing the new window opened. This is a showstopper for me at least running Selenium 2.0b2 until i can migrate my tests to webdriver.
I think this problem you're having is a variation of http://code.google.com/p/selenium/issues/detail?id=1441 and a bunch of other similar bugs - which are likely fixed in Selenium 2.0rc2.
精彩评论