【发布时间】:2016-01-05 15:49:54
【问题描述】:
该应用程序是一个嵌入式 CEF3 C# MS Windows 应用程序,它已启用远程调试器地址。我遵循了 java 示例,我可以使用 java prg 控制应用程序。然而,我们使用 Python 作为主要的测试自动化语言,我尝试在 Python 中实现相同的代码,但我得到“cannot connect to chrome at 127.0.0.1:4444”。 我在这里想念什么:
import selenium
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import time
import os
os.environ["webdriver.chrome.driver"] = "D:/dev/desktop-automation/selenium/chromedriver.exe"
chromeOps = webdriver.ChromeOptions()
chromeOps.binary_location = "C:/Program Files (x86)/Path to application/Application.exe"
chromeOps.debugger_address = "127.0.0.1:4444"
browser = webdriver.Chrome(chrome_options=chromeOps)
time.sleep(3)
browser.get("http://example.com")
非常感谢您的帮助!
【问题讨论】:
标签: python selenium selenium-chromedriver chromium-embedded