2016-05-29 4 views
1

私は大きな問題を抱えています。つのインスタンスを持つことは、正常に動作します:マリオネットでFirefoxの2番目のインスタンスを追加する(ポートを変更する)

のpythonでそれを制御する
firefox.exe -marionette 

は、マリオネットが有効でFirefoxを起動

from marionette import Marionette 
client = Marionette('localhost', port=2828) 
client.start_session() 
client.execute_script("alert('o hai there!');") 

今、私は現在のものと並んで2番目のクライアントを追加したいです

firefox.exe -marionette --address=localhost:2829 

TRYI:、quick searchは--addressコマンドの結果python経由で制御するngの:

from marionette import Marionette 
client = Marionette('localhost', port=2829) 
client.start_session() 
client.execute_script("alert('o hai there!');") 

しかし私は、これが機能するように見えることはできません。

error: [Errno 10061] No connection could be made because the target machine actively refused it 

すべてのヘルプは大歓迎です。

+0

サーバーが2829で動作しているかどうかを確認するために 'telnet localhost 2829'を実行できますか? – SilentMonk

答えて

3

異なるプロファイルでfirefoxを異なるポートで受信させる必要があります。
<path-to-profile>/prefs.jsを編集し、firewallがこのプロフィールを使用していない場合はを保存してください。;

user_pref("marionette.defaultPrefs.port", 2829); 

ここで、firefox asを開始してください。

firefox -marionette --profile <path-to-profile> --new-instance& 

新しいプロファイルを作成する。

$ mkdir new_profile 
$ firefox --profile new_profile --new-instance 

とclose firefox。今すぐ持っていますnew_profile/prefs.js

関連する問題