2011-03-11 43 views
1

我想用我的自定義配置文件啓動firefox,並且在本次會話中添加一些插件(例如)從硒開始時,我希望他不會忘記它們。無法使用配置文件(不是臨時的)使用Selenium打開Firefox

我開始硒服務器

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

然後在硒服務器

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 

,我gettings錯誤是這樣的:

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

的所有日誌:

CMD = getNewBrowserSession & 1 = *定製firefox.exe -p SeleniumStatic -no-遠程& 2 = HT tttp://www.google.com 13:54:50.817 INFO - --->請求 htttttp:/ /本地主機:4444 /硒 - 服務器/驅動器 CMD = getNewBrowserSession & 1 = *定製 firefox.exe -p SeleniumStatic -no-遠程& 2 = H tttttp://www.google.com 13:54:50.823 INFO - 命令要求: getNewBrowserSession [*定製 firefox.exe -p SeleniumStatic -no遠程,htttttp://www.google.com]會話空13:54:50.824 INFO - 創造新的遠程會話 13 :54:50.832 INFO - Al位於會議 ad3e48137d024959863ab8bb4c297d55爲 httttp://www.google.com,發動... 13:54:54.615 INFO - 得到了結果: OK,上 會議ad3e48137d024959863ab8bb4c297d55一個 d3e48137d024959863ab8bb4c297d55 CMD =開放& 1 = HTTP: //www.wp.pl 13:55:23.588 INFO - --->請求 httttp:// localhost:4444/selenium-server/driver ?cmd = open & 1 = htttttp://www.wp。 PL &的sessionId = ad3e48137d024959863ab8bb4c297d55 13:55:23.595 INFO - 命令請求: 開放[htttttp://www.wp.pl,]會話 ad3e481 37d0249598 63ab8bb4c297d55 13:55:23.596 WARN - 你似乎是 從 httttp改變域://www.google.com到 htttttp://www.wp.pl這可能導致 從 '權限被拒絕'瀏覽器 (除非它正在運行爲* iehta或 *鉻,或者硒服務器在代理 注射模式runnttting)13:55:23.691 INFO - 得到了結果:Witrynie http://www.google.com聶udzielono üprawnien做odczytania wlasciwosci Window.document z on sessi on ad3e48137d024959863ab8bb4c297d55

當然,我已經進入代理在Firefox SeleniumStatic型材(本地主機:4444)

我在做什麼錯? 對不起我的英文不好:/

+0

你在使用硒2 b2嗎? – 2011-03-11 16:57:54

+0

@Russel Yang是 – oobe 2011-03-13 22:54:59

回答

0

改變你的命令,如下所示

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服務器的時候。

+0

@Automatedester 'INFO - --->請求http:// localhost:4444/selenium-server/driver ?cmd = getNewBrowserSession&1 = * firefox -no-remote&2 = http://www.google .com 08:44:15.263信息 - 檢查資源別名 08:44:15.265信息 - 命令請求:getNewBrowserSession [* firefox -no-remote,h ttp://www.google.com]在會話空 08 :44:15.269信息 - 創建新的遠程會話 08:44:15.285信息 - 結果:無法啓動新的瀏覽器會話:org.openqa。 selenium.server.browserlaunchers.InvalidBrowserExecutableException:瀏覽器可執行文件的指定路徑無效。在會議空' – oobe 2011-03-15 07:45:06

+0

刪除-no-remote,我相信它是因爲有一個空間 – AutomatedTester 2011-03-15 08:53:43

+0

也許..但我不想運行它與自定義,因爲當你以這種方式啓動Firefox ..你可以添加插件,最喜歡的www ..當你再次運行你有它..沒有你自定義你不.. ..配置文件緩存恢復.. – oobe 2011-03-15 16:39:16

相關問題