【问题标题】:Failed to start new browser session: Error while launching browser even when i when i set interner explorer as browser无法启动新的浏览器会话:即使我将内部资源管理器设置为浏览器,启动浏览器时也会出错
【发布时间】:2011-05-26 07:09:15
【问题描述】:

我得到的错误是:java.lang.RuntimeException:无法启动 Selenium 会话:无法启动新的浏览器会话:启动浏览器时出错

我使用的代码是:

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();

    }

}

【问题讨论】:

    标签: selenium


    【解决方案1】:

    您的代码中的 *iexplore 之后似乎有一个额外的空格。试试这个:

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

    【讨论】:

      猜你喜欢
      • 2023-03-10
      • 2010-11-27
      • 2015-04-08
      • 1970-01-01
      • 2011-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      相关资源
      最近更新 更多