【问题标题】:Can't open Firefox with profile (not temporary) with Selenium无法使用 Selenium 使用配置文件(不是临时)打开 Firefox
【发布时间】:2011-07-13 11:48:12
【问题描述】:

我想用我的自定义配置文件启动 Firefox,当我从 selenium 开始在这个会话中添加一些插件(例如)时,我希望他不要忘记它们。

我启动了 selenium 服务器

start "JAVA Selenium Server" java -jar selenium-server.jar -interactive -firefoxProfileTemplate "D:\Ogame\SeleniumStaticProfile"

然后在 selenium 服务器中

cmd=getNewBrowserSession&1=*custom firefox.exe -p SeleniumStatic -no-remote&2=http://www.google.com
cmd=open&1=httttp://www.hotmail.com
cmd=open&1=httttp://www.google.pl

我得到了类似的错误:

www.goole.com havent rights to read properties Window.seleniumMarker1299...

所有日志:

cmd=getNewBrowserSession&1=*自定义 firefox.exe -p SeleniumStatic -no-remote&2=ht tttp://www.google.com 13:54:50.817 INFO - ---> 正在请求 http://localhost:4444/selenium-server/driver ?cmd=getNewBrowserSession&1=*自定义 firefox.exe -p SeleniumStatic -no-remote&2=h tttttp://www.google.com 13:54:50.823 INFO - 命令请求: getNewBrowserSession[*自定义 firefox.exe -p SeleniumStatic -no-remote,htttttp://www.google.com] 在会话空 13:54:50.824 信息 - 创建新的远程会话 13:54:50.832 信息 - 分配的会话 ad3e48137d024959863ab8bb4c297d55 为 http://www.google.com,正在启动... 13:54:54.615 信息 - 得到结果: 好的,ad3e48137d024959863ab8bb4c297d55 开启 会话a d3e48137d024959863ab8bb4c297d55 cmd=open&1=http://www.wp.pl 13:55:23.588 信息 - ---> 请求 http://localhost:4444/selenium-server/driver ?cmd=open&1=htttttp://www.wp.pl&sessionId=ad3e48137d024959863ab8bb4c297d55 13:55:23.595 信息 - 命令请求: 在会话中打开 [htttttp://www.wp.pl, ] ad3e481 37d024959863ab8bb4c297d55 13:55:23.596 警告 - 你似乎 更改域从 http://www.google.com 到 htttttp://www.wp.pl 这可能会导致 来自浏览器的“权限被拒绝” (除非它运行为 *iehta 或 *chrome,或者 selenium 服务器正在代理中运行 注射模式)13:55:23.691 INFO - 得到的结果:Witrynie http://www.google.comnie udzielono u prawnien do odczytania wlasciwosci Window.document z 开会 ad3e48137d024959863ab8bb4c297d55

当然我已经在 Firefox SeleniumStatic 配置文件中输入了代理 (localhost:4444)

我做错了什么? 对不起我的英语不好:/

【问题讨论】:

    标签: firefox selenium


    【解决方案1】:

    将您的命令更改为如下所示

    cmd=getNewBrowserSession&1=*firefox -no-remote&2=http://www.google.com
    cmd=open&1=httttp://www.hotmail.com
    cmd=open&1=httttp://www.google.pl
    

    您不需要指定配置文件,因为您在启动 Selenium 服务器时已经这样做了。

    【讨论】:

    • @Automatedester INFO - ---> Requesting http://localhost:4444/selenium-server/driver ?cmd=getNewBrowserSession&1=*firefox -no-remote&2=http://www.google.com 08:44:15.263 INFO - Checking Resource aliases 08:44:15.265 INFO - Command request: getNewBrowserSession[*firefox -no-remote, h ttp://www.google.com] on session null 08:44:15.269 INFO - creating new remote session 08:44:15.285 INFO - Got result: Failed to start new browser session: org.openqa. selenium.server.browserlaunchers.InvalidBrowserExecutableException: The specifie d path to the browser executable is invalid. on session null
    • 去掉-no-remote,我确定是因为有空格
    • 也许......但我不想用自定义运行它,因为当你以这种方式启动 Firefox 时......你可以添加插件,最喜欢的 www.. 当你再次运行它时,你就有了。 . wothout custom you don't..配置文件缓存已恢复..
    猜你喜欢
    • 2016-12-25
    • 2021-04-28
    • 1970-01-01
    • 2013-09-17
    • 1970-01-01
    • 2020-10-24
    • 1970-01-01
    • 2017-11-07
    • 2016-06-25
    相关资源
    最近更新 更多