[webkit-changes] [WebKit/WebKit] db706f: [Win] Enable WebDriver automation with wincairo as...
Haruhisa SHIN
noreply at github.com
Tue Feb 13 00:11:23 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: db706f64b58197fa0c3fc1dda5303aecc8d5fdf8
https://github.com/WebKit/WebKit/commit/db706f64b58197fa0c3fc1dda5303aecc8d5fdf8
Author: Haruhisa SHIN <haruhisa.shin at open-tec.co.jp>
Date: 2024-02-13 (Tue, 13 Feb 2024)
Changed paths:
M Source/WebDriver/socket/SessionHostSocket.cpp
M Source/WebKit/PlatformWin.cmake
M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
A Source/WebKit/UIProcess/Automation/win/WebAutomationSessionWin.cpp
M Source/WebKit/UIProcess/WebProcessPool.cpp
M Source/WebKit/UIProcess/WebProcessPool.h
A Source/WebKit/UIProcess/win/AutomationClientWin.cpp
A Source/WebKit/UIProcess/win/AutomationClientWin.h
M Source/WebKit/UIProcess/win/WebProcessPoolWin.cpp
M Source/cmake/OptionsWin.cmake
M Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
M Tools/MiniBrowser/win/WebKitBrowserWindow.h
Log Message:
-----------
[Win] Enable WebDriver automation with wincairo as client
https://bugs.webkit.org/show_bug.cgi?id=198055
Reviewed by Fujii Hironori.
Allows UIProcess of wincairo to be controlled by WebDriver.
Page transitions, manipulation of elements, and keyboard/mouse
insteractions are possible.
However, some functions are not yet supported.
Also, until now, automation has been started on MainThread
and terminated on WorkerThread of the socket.
To avoid assertion fail by canSafelyBeUsed() of WeakRef,
changed the termination process to be performed on MainThread.
How to use:
1. launch MiniBrowser.exe with environment variable WEBKIT_INSPECTOR_SERVER.
> set WEBKIT_INSPECTOR_SERVER=127.0.0.1:1641
> WebKitBuild\Release\bin64\MiniBrowser.exe
2. launch WebDriver.exe on another console.
> WebKitBuild\Release\bin64\WebDriver.exe -t 127.0.0.1:1641 -p 12345
Then you would be able to use WebDriver by sending commands to
url "http://127.0.0.1:12345".
If you use Selenium, you could navigate your browser
with a script like the following:
```
from selenium import webdriver
options = webdriver.WebKitGTKOptions()
driver = webdriver.Remote(
command_executor="http://{0}:{1}".format('127.0.0.1', 12345),
options=options
)
try:
driver.get('https://docs.webkit.org/Ports/WindowsPort.html')
finally:
driver.quit()
```
* Source/WebDriver/socket/SessionHostSocket.cpp:
* Source/WebKit/PlatformWin.cmake:
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
* Source/WebKit/UIProcess/Automation/win/WebAutomationSessionWin.cpp: Added.
* Source/WebKit/UIProcess/WebProcessPool.cpp:
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/win/AutomationClientWin.cpp: Added.
* Source/WebKit/UIProcess/win/AutomationClientWin.h: Added.
* Source/WebKit/UIProcess/win/WebProcessPoolWin.cpp:
* Source/cmake/OptionsWin.cmake:
* Tools/MiniBrowser/win/WebKitBrowserWindow.cpp:
* Tools/MiniBrowser/win/WebKitBrowserWindow.h:
Canonical link: https://commits.webkit.org/274530@main
More information about the webkit-changes
mailing list