Coding with JS-WebdriverIO(wdio)

WebdriverIO is a JavaScript testing framework and is specifically used for automated testing of web applications. WebdriverIO is designed to execute test scenarios on web browsers and mobile devices using the Selenium WebDriver protocol.

WebdriverIO has a large community and extensive documentation. This makes it easier to find resources to solve your questions and understand advanced features.

Resources:

WebSite → https://webdriver.io/

Github Repohttps://github.com/webdriverio/webdriverio

Youtube Channel https://www.youtube.com/@webdriverio

Discord Community → https://discord.webdriver.io/

UIAutomator2 Driver → https://github.com/appium/appium-uiautomator2-driver

XCUITest Driver → https://appium.github.io/appium-xcuitest-driver/5.1/server-args/

 

JS- WebdriverIO project’s package.json default dependencies:

{ "name": "wb_test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "axios": "^1.6.2", "chai": "^4.3.10", "webdriverio": "8.13.13", "should": "^13.1.3" }, "devDependencies": { "mocha": "^10.2.0", "mocha-json-output-reporter": "^2.1.0" } }

Above are the libraries added to your JS-WebdriverIO project.

resetApp() used on iOS devices has been deprecated with Appium 2.0.

Screenshot 2024-03-13 at 13.27.13.png
Screenshot 2024-03-13 at 13.27.23.png

Additional info
When creating Mobile Automation scripts,

If the element type is id:

var elem : driver.$(id:myElement)

If the element type is accessibility:

var elem : driver.$(~myElement)

You don't need to add any prefix when using XPath.

While creating Web Automation scripts,

If the element type is id: