Selenium webdriver without starting selenium Server

106 views
Skip to first unread message

sarthak

unread,
Aug 5, 2011, 5:45:06 AM8/5/11
to Selenium Users
Hi,

I am trying to run the selenium webdriver testcase without starting
the selenium server. It should Ideally work. But I always get
connection refused error.

com.thoughtworks.selenium.SeleniumException: Connection refused:
connect

If i start my Server then it works fine. Is there any way to make my
selenium tests independent of my Server? (which was one of the reasons
i was planning to move to Webdriver. )

My testcode:

@Test
public void login_FF() throws Exception {

FirefoxDriver driver = new FirefoxDriver();
driver.get("https://www.lebara-mobile.co.uk");

new WebDriverWait(driver, 15).until(new
ElementPresent(By.linkText("Sign up / Login")));
driver.findElement(By.linkText("Sign up / Login")).click();

new WebDriverWait(driver, 20).until(new
ElementPresent(By.id("loginID")));
driver.findElement(By.id("loginID")).sendKeys("leb...@gmx.com");

new WebDriverWait(driver, 15).until(new
ElementPresent(By.id("loginID")));
driver.findElement(By.id("password")).sendKeys("lebara123");

new WebDriverWait(driver, 15).until(new
ElementPresent(By.xpath("//form[@id='login']/button")));
driver.findElement(By.xpath("//form[@id='login']/button")).click();

WebElement body = driver.findElement(By.tagName("body"));
//System.out.println(body.getText().contains("Activation
Complete!"));
System.out.println(body.getText());

}


Help appreciated.

Luke Inman-Semerau

unread,
Aug 5, 2011, 10:34:36 AM8/5/11
to seleniu...@googlegroups.com
Which jar are you using? Not sure on this answer, but I think you should be importing the standalone jar to your project (or if using maven, the selenium-server dependency)

I'm working with maven and have no problem running tests without starting a server.

-Luke

> --
> You received this message because you are subscribed to the Google Groups "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
>

Gulshan Saini

unread,
Aug 5, 2011, 5:02:45 PM8/5/11
to seleniu...@googlegroups.com
instead of using "FirefoxDriver driver = new FirefoxDriver()" use WebDriver driver = new FirefoxDriver()
this should solve your problem

sarthak

unread,
Aug 10, 2011, 5:37:08 AM8/10/11
to Selenium Users
I am trying to use Maven. If I run without starting selenium server, I
get

com.thoughtworks.selenium.SeleniumException: Connection refused:
connect
at
com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:
110)

Can you tell me which exact jar to use so that I can put that and
see.

Thanks,
Sarthak

On Aug 5, 3:34 pm, Luke Inman-Semerau <luke.seme...@gmail.com> wrote:
> Which jar are you using? Not sure on this answer, but I think you should be importing the standalone jar to your project (or if using maven, the selenium-server dependency)
>
> I'm working with maven and have no problem running tests without starting a server.
>
> -Luke
>

Krishnan Mahadevan

unread,
Aug 10, 2011, 6:37:04 AM8/10/11
to seleniu...@googlegroups.com
Can you please share your dependencies section from your pom file ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

Luke Inman-Semerau

unread,
Aug 10, 2011, 11:27:03 AM8/10/11
to seleniu...@googlegroups.com
http://seleniumhq.org/download/maven.html

The "selenium-server" one. Make sure you have no other selenium dependencies specified.

-Luke

Reply all
Reply to author
Forward
0 new messages