簡體   English   中英

我如何控制firefox(從opt -no-remote在遠程PC上啟動)?

[英]How can i control firefox (started on remote pc with opt -no-remote)?

任務:使用ssh登錄到另一台PC,然后從那里啟動Firefox(選項-no-remote)。 然后在其中執行一些操作。

我使用python + selenium,但我不知道如何控制遠程firefox。 有人可以幫助我嗎?

================================================== =================

關於俄語Задача-залогинитьсянадругуюмашинуиоткрытьснееудаленныйfirefoxспараметрами-無遠程。 Потомнужноспомощьюселениумасделатьвинтерфейсенесколькодействий。

Пользоватьсяжелательноспомощьюпитонаиселениума。 Естьлиукогонибудькакие-нибудьпредложения?

UPD 21.11.14:我在遠程PC上安裝了python + selenium。 我將一些控制Firefox的代碼移到了那里。 我查找了示例,並得到了以下示例:

def testfunc():
    cmd="python2.7 BIND.py" # Remote test
    result = commands.getoutput(cmd)

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname=mil_ws, username=user, password=secret, port=portSSH)
t = client.get_transport ()  
chan = t.open_session ()  
chan.request_x11 (handler=testfunc())  
chan.set_combine_stderr (True)  
bufsize = -1  
stdin = chan.makefile('wb', bufsize)  
stdout = chan.makefile('rb', bufsize)  
stderr = chan.makefile_stderr('rb', bufsize)  
client.close()

問題是腳本在我的計算機上而不是在遠程計算機上運行Firefox。 如果我在遠程xterm上啟動BIND.py-Firefox正確啟動。 如何通過我的主要測試啟動遠程Firefox?

PS對不起,我的英語不好

Selenium Remote Control似乎是承載遠程測試會話的產品。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM