zoukankan      html  css  js  c++  java
  • 怎么利用 ChromeDriver 和 Selenium对 CEF应用进行自动化测试-python实现

    In my cefpython application I specify a remote debug port:

     switches = {"remote-debugging-port": "22222"}
     cefpython.Initialize(settings, switches)
    

    Run chromedriver:

     chromedriver --port=33333
    

    I'm using selenium python bindings:

     from selenium import webdriver
     chromeOptions = {'debuggerAddress':'192.168.1.42:22223'}
     capabilities = {'chromeOptions':chromeOptions}
     browser = webdriver.Remote('http://127.0.0.1:33333' capabilities)
     browser.get("http://www.google.com"
    

    I wanted chromedriver and selenium on a remote machine so used an ssh tunnel on
    the client:

     ssh -L 0.0.0.0:22223:localhost:22222 localhost
    

    A nice bonus is that in chrome I can access "192.168.1.42:22223" and can use
    the chrome dev tools on the open tabs in my remote browser.

    P.S. If you don't want to specify the port you need to add the
    "--remote-debugging-port" chromedriver supplies your app to the switches
    dictionary. Also in the selenium script:

     options = webdriver.ChromeOptions()
     options.binary_location = "/path/to/app"
     browser = webdriver.Chrome(chrome_options=options)
    
  • 相关阅读:
    枚举8项素数和环
    登录过滤器
    线程调度
    回溯素数环
    centos 6.5 samba简单配置
    区间k大数查询
    Centos安装arm-linux-gcc等交叉工具链
    centos7安装tftp服务器
    八皇后问题
    输出1——n的排列(深度优先搜索)
  • 原文地址:https://www.cnblogs.com/qingmiaokeji/p/12219752.html
Copyright © 2011-2022 走看看