-
Notifications
You must be signed in to change notification settings - Fork 59
-
How to use QtWebDriver in headless mode?
This can be dealt with at host level, Qt level or using docker.
-
On a linux host:
- By using the offscreen QPA :
$ QT_QPA_PLATFORM=offscreen WebDriver --verbose
- Or by using xvfb:
$ sudo apt-get install xvfb && xvfb-run -a WebDriver --verbose
- By using the offscreen QPA :
-
Or using Docker: The QtWebDriver container runs by default in headless mode, see Docker
-
How to simulate KeyPress auto repeat?
When processing:
/session/:sessionId/keys
/session/:sessionId/element/:id/value
For each sequence of similar keys in the
value
, WD will generateQKeyEvents
with theisAutoRepeat
the next events- first KeyPress event isAutoRepeat =
false
- last KeyRelease event isAutoRepeat =
false
- all intermediary events isAutoRepeat =
true
- E.G:
This python test code
elem.send_keys(Keys.UP + Keys.UP)
will generate- Event 1: type = press, code = UP, isAutoRepeat = false
- Event 2: type = release, code = UP, isAutoRepeat = true
- Event 3: type = press, code = UP, isAutoRepeat = true
- Event 4: type = release, code = UP, isAutoRepeat = false
-
How are Undefined keys processed?
When processing key codes with:
-
/session/:sessionId/keys
-
/session/:sessionId/element/:id/value
For all key values not part of the predefined WebDriver keys: https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/value, the corresponding Qt::Key will be generated as follows:Qt::Key qt_key_code = 0x01000000 + (key - 0xE000U):
eg: to generate
0x1000086
send\uE086
via Selenium
-
Home | Build And Run | Releases | Features
Copyright © 1992-2016 Cisco and/or its affiliates