thread safety

4 views
Skip to first unread message

Danny G

unread,
Nov 16, 2009, 11:29:07 PM11/16/09
to webdriver
Does anyone have an example of how to thread safely instantiate an IE
driver?
I've tried synchronizing a getter but for the life of me I can't get
these test to consistently end in the same fashion.

Some times the test passes and when I run it again I get this
exception when creating the driver.

While evaluating expression: #result = testLogin(#userName,
#userPassword, #userDomain)
org.concordion.internal.InvalidExpressionException:
IllegalStateException: Cannot create new browser instance: 21at
org.openqa.selenium.ie.InternetExplorerDriver.<init>
(InternetExplorerDriver.java:70)at
com.appsec.console.webdriver.BrowserDriver2.<init>
(BrowserDriver2.java:10)at
com.appsec.fixture.console.login.Login.testLogin (Login.java:21)
public class BrowserDriver {

private WebDriver browserDriver;
public BrowserDriver2() {
Line10 -> this.browserDriver = new InternetExplorerDriver();
}

public synchronized WebDriver getInstance() {

return browserDriver;
}

}

Daniel Wagner-Hall

unread,
Nov 17, 2009, 6:10:19 AM11/17/09
to webd...@googlegroups.com
The IE driver isn't threadsafe. There is no way to run multiple IE
drivers in parallel, due to restrictions with how IE runs in Windows.
Sorry!
Reply all
Reply to author
Forward
0 new messages