appium-inspector
appium-inspector copied to clipboard
Driver.init is not a function ?
This is my code, it is generated by appium-inspector
test.js
const wdio = require('webdriverio');
const caps = { ... }
const driver = wdio.remote({
protocol: "http",
host: "127.0.0.1",
port: 4723,
path: "/wd/hub",
desiredCapabilities: caps
});
driver.init()
.element("~phoneField")
.setValue("0908011111")
.element("~passwordField")
.setValue("abcde")
.end();
I run it -> node test.js I get this: driver.init() ^ TypeError: driver.init is not a function
can you help me? What happened?
Environment
- I am on (pick one):
- [x] Mac
- [ ] Windows
- [ ] Linux
it looks like the generated code may be out of date with webdriverio. please refer to the webdriverio docs and they should show you how to start a session. you can then adjust the generated code to be correct. (and maybe raise a PR here to fix the way the code is generated?)
@jlipps I have updated the recorder script for webdriverio with the latest documentation and raised PR #636 . Kindly review and let me know your thoughts. Thanks:)