Skip to content

Instantly share code, notes, and snippets.

@christian-bromann
Created November 9, 2017 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christian-bromann/01ed768b00f5d82cd9f91fac54b82544 to your computer and use it in GitHub Desktop.
Save christian-bromann/01ed768b00f5d82cd9f91fac54b82544 to your computer and use it in GitHub Desktop.
Actions API demo using WebdriverIO in standalone mode
(async function () {
const webdriverio = require('webdriverio')
const browser = webdriverio.remote({
path: '/',
desiredCapabilities: {
browserName: 'firefox'
}
})
await browser.init()
await browser.url('http://webdriverio.christian-bromann.com/draw.html')
await browser.actions([{
"type": "pointer",
"id": "finger1",
"actions": [
{"type": "pointerMove", "duration": 0, "x": 300, "y": 100},
{"type": "pointerDown", "button": 0},
{"type": "pause", "duration": 500},
{"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": 0, "y": 400},
{"type": "pointerUp", "button": 0}
]
}])
await browser.actions([{
"type": "pointer",
"id": "finger2",
"actions": [
{"type": "pointerMove", "duration": 0, "x": 100, "y": 300},
{"type": "pointerDown", "button": 0},
{"type": "pause", "duration": 500},
{"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": 400, "y": 0},
{"type": "pointerUp", "button": 0}
]
}])
await browser.end()
})()
@howtoautomateinth
Copy link

Which chromedriver version are you using?
since I found "unimplemented command: session/8c84a92d402a60f98502f497140c6ed4/actions"

@christian-bromann
Copy link
Author

This is using Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment