-
Notifications
You must be signed in to change notification settings - Fork 59
Key Input
-
Enable customization of long keypress behavior: https://github.com/cisco-open-source/qtwebdriver/issues/12 This is an alternative behavior to the one added in Manage key auto repeat below 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
This beahvior is chosen at build time by setting the
WD_CONFIG_ONE_KEYRELEASE
flag in thewd.gypi
file, as follows:
{
'variables': {
'QT5': '1', # change to '0' to disable Qt5
'WD_CONFIG_QWIDGET_BASE': '1', # 1 to support widget or hybrid web
'WD_CONFIG_WEBKIT': '1', #1 to support Web views
'WD_CONFIG_QUICK': '1', #1 to support QML
'WD_BUILD_MONGOOSE': '1', #1 to inline mongoose code in WebDriver libraries. Otherwise CISCO_MONGOOSE paths below will be needed
'WD_CONFIG_PLAYER': '0', #Set to 1 if qtmultimedia should be built. In case of Hawaii Cisco profile, set to 0
'WD_CONFIG_ONE_KEYRELEASE': '1', # Set to 1 so that only the final key release is sent
'QT_INC_PATH': '/home/user/Qt/5.2.0/gcc_64/include',
'QT_BIN_PATH': '/home/user/Qt/5.2.0/gcc_64/bin',
'QT_LIB_PATH': '/home/user/Qt/5.2.0/gcc_64/lib'
},
}
-
Manage key auto repeat: https://github.com/cisco-open-source/qtwebdriver/issues/9
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
-
Undefined keys: https://github.com/cisco-open-source/qtwebdriver/issues/11
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