Skip to content
hekra01 edited this page Jan 30, 2017 · 7 revisions
  • 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
  • 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 generate QKeyEvents with the isAutoRepeatthe 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:

Clone this wiki locally