cybage
cybage

Reputation: 1

Failed to start new browser session: Error while launching browser even when i when i set interner explorer as browser

The error i got is : java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser

The code i used is:

package Gmail;

import com.thoughtworks.selenium.*;

import junit.framework.TestCase;

public class Login extends TestCase{

    public static DefaultSelenium selenium =new DefaultSelenium("localhost", 4444, "*iexplore ", "http://");

    public static void gmailLogin()
    {
        try
        {
            selenium.start();
            selenium.open("http://www.gmail.com");
            selenium.type("Email", "<EmailID>");
            selenium.type("Passwd", "<Password>");
            selenium.click("signIn");
            selenium.setTimeout("50000");
            selenium.focus("//input[@name='Sign out']");
            selenium.click("//input[@name='Sign out']");
            selenium.setTimeout("50000");
        }
        catch (Exception E){System.out.println(E);}
        selenium.stop();
    }

    public static void main(String[] args) {

        gmailLogin();

    }

}

Upvotes: 0

Views: 4137

Answers (1)

A.J
A.J

Reputation: 4949

Seems like there is an extra space after *iexplore in your code. Try this:

public static DefaultSelenium selenium =new DefaultSelenium("localhost", 4444, "*iexplore", "http://");

Upvotes: 1

Related Questions