Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webdriverio

Package Overview
Dependencies
Maintainers
3
Versions
730
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webdriverio

Next-gen browser and mobile automation test framework for Node.js

  • 9.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
decreased by-12.11%
Maintainers
3
Weekly downloads
 
Created

What is webdriverio?

WebdriverIO is an open-source testing utility for Node.js that allows you to control a browser or a mobile application with just a few lines of code. It is built on top of WebDriver protocol and supports both desktop browsers and mobile applications. It provides a lot of useful features to create end-to-end tests, supports synchronous and asynchronous modes, and integrates with various test frameworks like Mocha, Jasmine, and Cucumber.

What are webdriverio's main functionalities?

Browser Automation

Automate web browsers by performing actions like navigating to URLs, clicking on elements, and retrieving page information.

const { remote } = require('webdriverio');

(async () => {
  const browser = await remote({
    capabilities: { browserName: 'chrome' }
  });

  await browser.url('https://example.com');
  const title = await browser.getTitle();
  console.log('Title was: ' + title);

  await browser.deleteSession();
})();

Element Interaction

Interact with web elements such as input fields, buttons, and links by sending keystrokes, clicking, and retrieving attributes.

const { remote } = require('webdriverio');

(async () => {
  const browser = await remote({
    capabilities: { browserName: 'chrome' }
  });

  await browser.url('https://example.com/login');
  await browser.setValue('#username', 'user123');
  await browser.setValue('#password', 'pass123');
  await browser.click('#submit');

  await browser.deleteSession();
})();

Mobile Application Testing

Test mobile applications by launching them on simulators, emulators, or real devices and interacting with them just like with browser automation.

const { remote } = require('webdriverio');

(async () => {
  const browser = await remote({
    path: '/wd/hub',
    capabilities: {
      platformName: 'Android',
      'appium:deviceName': 'emulator',
      'appium:app': '/path/to/your.app'
    }
  });

  // Your mobile testing code here

  await browser.deleteSession();
})();

Integration with Test Runners

Easily integrate with test runners like Mocha, Jasmine, or Cucumber to create structured and maintainable test suites.

const { remote } = require('webdriverio');

describe('My application', () => {
  it('should work with webdriverio', async () => {
    const browser = await remote({
      capabilities: { browserName: 'chrome' }
    });

    await browser.url('https://example.com');
    expect(await browser.getTitle()).toBe('Expected Title');

    await browser.deleteSession();
  });
});

Other packages similar to webdriverio

Keywords

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc