4

私は、Selenium Webdriver for Pythonでの私の経験を活用して、電子アプリケーションをEnd2EndテストするためにSpectronを使用してバイパスしようとしています。 その可能性を示唆しているように見えるChromedriver始めるページの組み合わせ、およびいくつかのresourcesを使用して、これは私が思い付いたものです:Python Selenium Webdriverを使用してElectronアプリケーションを開く

from selenium import webdriver 
import selenium.webdriver.chrome.service as service 
servicer = service.Service('C:\\browserDrivers\\chromedriver_win32\\chromedriver.exe') 
servicer.start() 
capabilities = {'chrome.binary': 'C:\\path\\to\\electron.exe'} 
remote = webdriver.remote.webdriver.WebDriver(command_executor=servicer.service_url, desired_capabilities = capabilities, browser_profile=None, proxy=None, keep_alive=False 

問題ではなく、電子アプリケーションを開くと、それはA開くということですChromeの標準インスタンス

私が見たリソースの大部分は数年前のことですので、何かが変更されてもはやそれができなくなる可能性があります。

ElectronアプリケーションをテストするためにPython Selenium WebDriverを使用する方法を知っている人はいますか?以下は

答えて

4

from selenium import webdriver 


options = webdriver.ChromeOptions() 
options.binary_location = "/Applications/Electron.app/Contents/MacOS/Electron" 

driver = webdriver.Chrome(chrome_options=options) 

driver.get("http://www.google.com") 


driver.quit() 
+0

は、明らかに私は道の上にそれを複雑な私のために素晴らしい作品。ありがとう! –

関連する問題