Selenium error on Win7
Posted
by
hawkeye
on Stack Overflow
See other posts from Stack Overflow
or by hawkeye
Published on 2010-12-22T06:44:39Z
Indexed on
2010/12/23
3:54 UTC
Read the original article
Hit count: 774
I'm starting Selenium server with the following on a command line:
java -jar selenium-server.jar
Here is the code:
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
import org.openqa.selenium.server.SeleniumServer;
import junit.framework.*;
public class orkut extends SeleneseTestCase {
public void setUp() throws Exception {
//SeleniumServer server = new SeleniumServer();
//server.start();
setUp("https://www.google.com/", "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
}
public void testOrkut() throws Exception {
selenium.setTimeout("10000");
selenium.open("/accounts/ServiceLogin?service=orkut&hl=en-US&rm=false&continue=http%3A%2F%2Fwww.orkut.com%2FRedirLogin%3Fmsg%3D0&cd=IN&skipvpage=true&sendvemail=false");
selenium.type("Email", "username");
selenium.type("Passwd", "password");
selenium.click("signIn");
selenium.selectFrame("orkutFrame");
selenium.click("link=Communities");
selenium.waitForPageToLoad("10000");
}
public static Test suite() {
return new TestSuite(orkut.class);
}
public void tearDown(){
selenium.stop();
}
public static void main(String args[]) {
junit.textui.TestRunner.run(suite());
}
}
Here is the error:
.E
Time: 33.386
There was 1 error:
1) testOrkut(orkut)java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Unable to delete file C:\Users\user\AppData\Local\Temp\customProfileDir78cf02e3efca4772a71525c4a7523cac\parent.lock
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:123)
at com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:104)
at com.thoughtworks.selenium.SeleneseTestCase.setUp(SeleneseTestCase.java:78)
at orkut.setUp(orkut.java:14)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
at orkut.main(orkut.java:37)
Caused by: com.thoughtworks.selenium.SeleniumException: Failed to start new browser session: Unable to delete file C:\Users\M022534\AppData\Local\Temp\customProfileDir78cf02e3efca4772a71525c4a7523cac\parent.lock
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223)
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81)
... 16 more
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
© Stack Overflow or respective owner