GithubHelp home page GithubHelp logo

lambdatest / webdriverio-selenium-sample Goto Github PK

View Code? Open in Web Editor NEW
14.0 10.0 36.0 134 KB

A sample test for LambdaTest distributed grid with webdriverio

Home Page: https://www.lambdatest.com/

JavaScript 100.00%
webdriverio selenium automation grid

webdriverio-selenium-sample's Introduction

WebdriverIO Tutorial

WebdriverIO Integration with LambdaTest

WebdriverIO is a custom implementation for selenium's W3C webdriver API. It is written in Javascript and packaged into 'npm' and runs on Node.js.

Prerequisites for WebdriverIO

  1. Download Visual Studio (IDE) for your operating system.
  2. Node.js and Package Manager (npm) : Install Node.js from their official website Or Install Node.js using command line. Go to the terminal or command prompt & run the below command.

$ install node

To verify the node version (Node version < 15)

$ node -v

  1. Install Selenium Dependencies

npm install selenium-webdriver

  1. LambdaTest Authentication Credentials: Make sure you have your LambdaTest credentials with you to run test automation scripts with Jest on LambdaTest Selenium Grid. You can obtain these credentials from the LambdaTest Automation Dashboard or through LambdaTest Profile.

Set LambdaTest Username and Access Key in environment variables.

  • For Linux/macOS: export LT_USERNAME="YOUR_USERNAME" export LT_ACCESS_KEY="YOUR ACCESS KEY"

  • For Windows: set LT_USERNAME="YOUR_USERNAME" set LT_ACCESS_KEY="YOUR ACCESS KEY"

  1. Ensure that you have Webdriverio installed in your system, you can install it using the below command through npm.

$ npm install webdriverio

Try Demo in Gitpod

Select the button below to try this demo in Gitpod

Open in Gitpod

After the gitpod session launches, navigate to the terminal and run the following commands to save your LambdaTest Credentials to gitpod as environment variables:

eval $(gp env -e LT_USERNAME=******)
eval $(gp env -e LT_ACCESS_KEY=******)

Click the following link if you're unsure how to access your LambdaTest credentials. Also, if you start a new terminal in gitpod, you have to run the following command to reset envrionment variables:

eval $(gp env -e)

For more information consult the gitpod documentation


Setting Up The Project In Visual Studio IDE

Step 1 : After installation of the Visual Studio IDE, create a folder in your local system to save all the projects.

Step 2 : Install the below extensions for JavaScript from ‘Extensions’ in VScode Editor.

  • Code Runner
  • JavaScript( ES6) code snippet
  • ES Lint

Step 3 : Press ‘Ctrl+Shift+P’ and search for git:clone. Paste the URL of this repositoryhttps://github.com/LambdaTest/webdriverio-selenium-sample.git to clone.

Step 4 : Press ENTER and save the WebdriverIO project in the above created folder.

Step 5: Create a project directory named webdriverio-selenium-sample directory in the VS code (IDE).

Step 6: Initialize your project by hitting the command npm init. This will create a package.json file in an interactive way, which will contain all our required project configurations. It will be required to execute our test script. Here is that package.json.

{
  "name": "webdriverio-lambdatest",
  "version": "0.1.0",
  "readme": "WendriverIO Integration with [LambdaTest](https://www.lambdatest.com)",
  "description": "Selenium examples for WebdriverIO and LambdaTest Selenium Grid",
  "scripts": {
    "test": "npm run single && npm run parallel && npm run multiple",
    "single": "./node_modules/.bin/wdio conf/single.conf.js",
    "parallel": "./node_modules/.bin/wdio conf/parallel.conf.js",
    "multiple": "./node_modules/.bin/wdio conf/multiple.conf.js",
    "integration": "./node_modules/.bin/wdio conf/integration.conf.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/lambdatest/webdriverio-selenium-sample.git"
  },
  "keywords": [
    "webdriverio",
    "lambdatest",
    "automation",
    "selenium",
    "tests"
  ],
  "bugs": {
    "url": "https://github.com/lambdatest/webdriverio-selenium-sample/issues"
  },
  "homepage": "https://github.com/lambdatest/webdriverio-selenium-sample#readme",
  "dependencies": {
    "chai": "*",
    "mocha": "*",
    "selenium-webdriver": "^4.3.1",
    "webdriverio": "^8.3.3"
  },
  "devDependencies": {
    "@wdio/cli": "*",
    "@wdio/local-runner": "*",
    "@wdio/mocha-framework": "*",
    "@wdio/sync": "*",
    "async-request": "^1.2.0",
    "wdio-lambdatest-service": "*"
  }
}

Note: In case, you’re importing the sample, you would need to give the below command to install all dependencies mentioned in the package.json file in the sample code.

$ npm i or $ npm install

Executing First Webdriverio Test Script

Test Scenario

The test script will do the following actions:

  1. Invoke the browser launch.
  2. Go to www.google.com.
  3. Type test123 in the search box.
  4. Fetch the title of the web page.
  5. Close the browser and display the fetched title in the console.

That’s it. Before we deep dive into the test script, we need to declare our desired capabilities. These desired capabilities will help us define the testing environment such as browser version, operating system, and more. You can leverage LambdaTest Desired Capabilities Generator to specify the desired capabilities class.

Let us fetch the desired capabilities class from the LambdaTest Desired Capabilities Generator to run the script on LambdaTest cloud-based Selenium Grid.

capability-generator

With the capability generator, you can specify a variety of configurations in multiple programming languages.

Test Scripts For Running WebdriverIO Test On A Single Configuration

We’ll create a JavaScript file single_test.js for running the test script using WebdriverIO, as per the test scenario.


const assert = require('assert');
 
describe('Google Search Function', () => {
  it('can find search results', () => {
    browser.url('https://www.google.com/ncr');
    const input = $('[name="q"]');
    input.setValue('test123');
 
    const title = browser.getTitle();
    assert.equal(title, 'Google');
  });
});

Create configuration file:

To run the script, we would also need a configuration file to provide the capabilities, which can be generated using the capabilities generator. The configuration file will also contain the credentials of user i.e username and access key and the Hub URL. In case, the script requires tunnel connection, we can set the tunnel: true in the services. This will automatically download the tunnel binary to the project, start it before test execution and close after the test is executed.

Below is the snippet of the configuration file for single_test.js named by single.conf.js in the conf folder.

exports.config = {
  services: [
    [
      "lambdatest",
      {
        tunnel: false,
        lambdatestOpts: {
          logFile: "tunnel.log"
        }
      }
    ]
  ],
  user: process.env.LT_USERNAME,
  key: process.env.LT_ACCESS_KEY,
  buildName: process.env.LT_BUILD_NAME,
  specs: ["../tests/specs/single_test.js"],
  exclude: [],

  capabilities: [
    {
      "LT:Options": {
      browserName: "chrome",
      version: "latest",
      name: "Test WebdriverIO Single",
      build: "WebDriver Selenium Sample"
    }
    }],
  logLevel: "info",
  coloredLogs: true,
  screenshotPath: "./errorShots/",
  waitforTimeout: 100000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 1,
  path: "/wd/hub",
  hostname: "hub.lambdatest.com",
  port: 80,
  framework: "mocha",
  mochaOpts: {
    ui: "bdd",
    timeout: 50000,
  }
};

If you notice the package.json, you will find required dependencies added for the single.conf.js.

Running The First WebdriverIO Test Script

Open terminal or command prompt in the project directory where you cloned GitHub repository for WebdriverIO, then run the below command to execute your first WebdriverIO test script on LambdaTest Selenium Grid. As per our declared capabilities, this test should run over Google Chrome 64.

npm run single

The above command is defined in the package.json file, and can be provided with any name as per the user’s convenience. Following is the snippet of the same:

"scripts": {
    "test": "npm run single,
     single": "./node_modules/.bin/wdio conf/single.conf.js"
}

Once you run the command, you can notice whether the test passed or failed which can over LambdaTest Automation Dashboard. In the below snapshot, we can see the test got passed.

Also , if you look at your Output Console, you will find the title of the web page.

Testing Locally Hosted Web-Applications

In case, the script requires tunnel connection, we can set the tunnel: true in the services. This will automatically download the tunnel binary to the project, start it before test execution and close after the test is executed. We did this in single conf.js if you didn’t notice.

exports.config = {
  services: [
    [
      "lambdatest",
      {
        tunnel: true,
        lambdatestOpts: {
          logFile: "tunnel.log"
        }
      }
    ]
  ]
  • Set tunnel = true
  • Set tunnelName = 'Identifier name' (recommended as a tunnel identifier in case of more than 1 tunnels being connected)

Curious to know more about Lambda Tunnel To Test Locally Hosted Pages?

Refer to our support documentation for more information on Lambda Tunnel.

Want To Run Lambda Tunnel Without Using Command Line?

Download the Underpass app for your operating system. Refer to our support documentation for more information on Lambda Underpass-tunnel-app

Parallel Execution

Webdriverio does support parallel execution of code, i.e. execution of same code simultaneously on multiple browsers/device combinations which not only saves efforts to test the code, but also reduces the total execution time of tests.

To perform parallel execution of the above WebdriverIO test script over LambdaTest Selenium Grid, you would only need to modify the configuration file with multiple capabilities. Following is the snippet for the same. You can find this file as parallel.conf.js.

exports.config = {
  services: [
    [
      "lambdatest",
      {
        tunnel: true,
        lambdatestOpts: {
          logFile: "tunnel.log"
        }
      }
    ]
  ],
  user: 'Your_LambdaTest_Username',
  key: 'Your_LambdaTest_Access_Key',
  specs: [
    '../tests/specs/single_test.js'
  ],
  exclude: [],
 
  maxInstances: 10,
  commonCapabilities: {
    // name: 'Parallel Sample Test',
    // build: 'WebDriver Selenium Sample'
  },
 
  capabilities: [
    {
      platform: "win10",
      browserName: "chrome",
      version: "64.0"
    },
    {
      platform: "win10",
      browserName: "firefox",
      version: "64.0"
    },
    {
      platform: "win10",
      browserName: "internet explorer",
      version: "11.0"
    }
  ],
 
  logLevel: "info",
  coloredLogs: true,
  screenshotPath: "./errorShots/",
  baseUrl: "",
  waitforTimeout: 10000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,
  path: "/wd/hub",
  hostname: "hub.lambdatest.com",
  port: 80,
  framework: "mocha",
  mochaOpts: {
    ui: "bdd",
    timeout: 50000,
  }
};
 
// Code to support common capabilities
exports.config.capabilities.forEach(function(caps) {
  for (var i in exports.config.commonCapabilities)
    caps[i] = caps[i] || exports.config.commonCapabilities[i];
});

In the above code, we have provided multiple capabilities to execute the same code on Google Chrome 64, Mozilla Firefox 64 and IE 11 simultaneously on Windows 10. Note: To run parallel test, we also defined separate command: npm run parallel in our package.json file, like below:

"scripts": {
    "test": "npm run single && npm run parallel",
    "single": "./node_modules/.bin/wdio conf/single.conf.js",
    "parallel": "./node_modules/.bin/wdio conf/parallel.conf.js",
 }

So, the above script will run on different browsers simultaneously with the below command as defined above in the package.json file.

npm run parallel

Below is the screenshot for the parallel test execution in the LambdaTest Automation Dashboard.

Running test with QA - Deputy integration

testRunId={test_run_id} testCaseId={test_case_id} apiToken={api_token} email={email} npm run integration if you do not wish to pass above arguments via you can provide their values within test itself, they are declared in tests/specs/integration_test.js:L11-L15

About LambdaTest

LambdaTest is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your selenium automation testing to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.

Resources

webdriverio-selenium-sample's People

Contributors

4dvanceboy avatar arpitlt avatar ganeshlt avatar kanhaiya15 avatar koshindergurjar avatar muditlambda avatar mukesh-lt avatar nikhil-lambda avatar niteshsharma30 avatar psych0der avatar rahulmishra-lt avatar sururocks avatar sushobhit-lt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webdriverio-selenium-sample's Issues

[Gitignore] Missing gitignore file

Issue

Gitignore file is missing. As a consequence when running npm install git marks node_modules as new changes.

Solution

Add .gitignore file with node_modules exclusion to the root folder.

[Documentation] Fix Readmefile

Issue

In the README.md under the section Running your tests there are 3 examples of commands

    To run a single test, run npm run single
    To run local tests, run npm run local
    To run parallel tests, run npm run parallel

Solution

But actually there is no local script. There are only multiple, parallel and single tests. Please add local to tests and multiple to the README.md file.

Tests in queue do not run after active test completes

When I have more than one test, the tests that are in the queue do not run and sometimes double after longs periods of waiting. The problem seems to be the amount of time it waits after the test completes. You can see in the stack trace below that the connection does retry and reconnect, but the connection waits 2-5 minutes after the first test completes to move onto the test case.

Execution of 2 spec files started at 2020-11-02T16:04:21.279Z

2020-11-02T16:04:21.491Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-11-02T16:04:21.501Z INFO @wdio/local-runner: Start worker 0-0 with arg: conf/desktop.conf.js
2020-11-02T16:04:21.529Z INFO @wdio/local-runner: Start worker 1-0 with arg: conf/desktop.conf.js
[0-0] 2020-11-02T16:04:22.163Z INFO @wdio/local-runner: Run worker command: run
[1-0] 2020-11-02T16:04:22.178Z INFO @wdio/local-runner: Run worker command: run
[0-0] RUNNING in Chrome - C:\Users\jeff\Documents\tools\lambdatest-webdriverio\webdriverio-selenium-sample\tests\specs\desktop_test.js
[1-0] RUNNING in Firefox - C:\Users\jeff\Documents\tools\lambdatest-webdriverio\webdriverio-selenium-sample\tests\specs\desktop_test.js
[0-0] 2020-11-02T16:04:22.640Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-11-02T16:04:22.644Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session
[0-0] 2020-11-02T16:04:22.644Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platform: 'Windows 10',
      browserName: 'Chrome',
      version: '86.0',
      resolution: '1920x1080',
      name: 'LambdaTest',
      build: 'LambdaTest',
      network: false,
      video: true,
      visual: false,
      console: false
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platform: 'Windows 10',
    browserName: 'Chrome',
    version: '86.0',
    resolution: '1920x1080',
    name: 'LambdaTest',
    build: 'LambdaTest',
    network: false,
    video: true,
    visual: false,
    console: false
  }
}
[1-0] 2020-11-02T16:04:22.661Z INFO webdriverio: Initiate new session using the webdriver protocol
2020-11-02T16:04:22.665Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session
2020-11-02T16:04:22.665Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platform: 'Windows 10',
      browserName: 'Firefox',
      version: '82.0',
      resolution: '1920x1080',
      name: 'LambdaTest',
      build: 'LambdaTest',
      network: false,
      video: true,
      visual: false,
      console: false
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platform: 'Windows 10',
    browserName: 'Firefox',
    version: '82.0',
    resolution: '1920x1080',
    name: 'LambdaTest',
    build: 'LambdaTest',
    network: false,
    video: true,
    visual: false,
    console: false
  }
}
[1-0] 2020-11-02T16:04:31.379Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/")
[1-0] 2020-11-02T16:04:31.379Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/url
2020-11-02T16:04:31.379Z INFO webdriver: DATA { url: 'https://mister-medicare.hatfield.marketing/' }
[1-0] 2020-11-02T16:04:33.221Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[1-0] 2020-11-02T16:04:33.222Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:33.222Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[1-0] 2020-11-02T16:04:33.326Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': 'b08e7002-6df4-442f-81db-840a3719ba31'
}
[1-0] 2020-11-02T16:04:33.332Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:33.332Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:33.332Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': 'b08e7002-6df4-442f-81db-840a3719ba31',
      ELEMENT: 'b08e7002-6df4-442f-81db-840a3719ba31'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:33.434Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[1-0] 2020-11-02T16:04:33.434Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:33.435Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[1-0] 2020-11-02T16:04:33.529Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': '7c9af7ac-c7ff-4f74-b70d-c7b6c39ba9f2'
}
[1-0] 2020-11-02T16:04:33.533Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:33.533Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:33.533Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '7c9af7ac-c7ff-4f74-b70d-c7b6c39ba9f2',
      ELEMENT: '7c9af7ac-c7ff-4f74-b70d-c7b6c39ba9f2'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:33.639Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/dental-plans")
[1-0] 2020-11-02T16:04:33.639Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/url
2020-11-02T16:04:33.639Z INFO webdriver: DATA { url: 'https://mister-medicare.hatfield.marketing/dental-plans' }
[1-0] 2020-11-02T16:04:35.105Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[1-0] 2020-11-02T16:04:35.105Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:35.105Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[1-0] 2020-11-02T16:04:35.206Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': '0290dd31-e1ae-4ab0-9ecc-47d4671308cb'
}
[1-0] 2020-11-02T16:04:35.210Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:35.211Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:35.211Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0290dd31-e1ae-4ab0-9ecc-47d4671308cb',
      ELEMENT: '0290dd31-e1ae-4ab0-9ecc-47d4671308cb'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:35.312Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[1-0] 2020-11-02T16:04:35.313Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:35.313Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[1-0] 2020-11-02T16:04:35.413Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': '846d858f-749b-4399-a1dc-fe6348ea43c3'
}
[1-0] 2020-11-02T16:04:35.415Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:35.415Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:35.415Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '846d858f-749b-4399-a1dc-fe6348ea43c3',
      ELEMENT: '846d858f-749b-4399-a1dc-fe6348ea43c3'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:35.513Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/about-mister-medicare")
[1-0] 2020-11-02T16:04:35.513Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/url
2020-11-02T16:04:35.513Z INFO webdriver: DATA {
  url: 'https://mister-medicare.hatfield.marketing/about-mister-medicare'
}
[1-0] 2020-11-02T16:04:37.748Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[1-0] 2020-11-02T16:04:37.749Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:37.749Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[1-0] 2020-11-02T16:04:38.070Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': 'e923b1f1-edc3-4ea4-b14d-4c8f90de8c7e'
}
[1-0] 2020-11-02T16:04:38.073Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:38.074Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:38.074Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': 'e923b1f1-edc3-4ea4-b14d-4c8f90de8c7e',
      ELEMENT: 'e923b1f1-edc3-4ea4-b14d-4c8f90de8c7e'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:38.205Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[1-0] 2020-11-02T16:04:38.205Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/element
2020-11-02T16:04:38.205Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[1-0] 2020-11-02T16:04:38.455Z INFO webdriver: RESULT {
  'element-6066-11e4-a52e-4f735466cecf': 'acebdb6a-060d-46a8-a9f1-fd2189d53766'
}
[1-0] 2020-11-02T16:04:38.458Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[1-0] 2020-11-02T16:04:38.459Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629/execute/sync
2020-11-02T16:04:38.459Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': 'acebdb6a-060d-46a8-a9f1-fd2189d53766',
      ELEMENT: 'acebdb6a-060d-46a8-a9f1-fd2189d53766'
    },
    true
  ]
}
[1-0] 2020-11-02T16:04:38.558Z INFO @wdio/lambdatest-service: Update job with sessionId 94ace3c4-7d43-4e34-8d2f-1d40c6592629, status: passed
[1-0] 2020-11-02T16:04:38.913Z INFO webdriver: COMMAND deleteSession()
[1-0] 2020-11-02T16:04:38.913Z INFO webdriver: [DELETE] http://hub.lambdatest.com:80/wd/hub/session/94ace3c4-7d43-4e34-8d2f-1d40c6592629
[1-0] PASSED in Firefox - C:\Users\jeff\Documents\tools\lambdatest-webdriverio\webdriverio-selenium-sample\tests\specs\desktop_test.js
[0-0] 2020-11-02T16:06:02.726Z WARN webdriver: Request failed due to ESOCKETTIMEDOUT
[0-0] 2020-11-02T16:06:02.726Z INFO webdriver: Retrying 1/5
2020-11-02T16:06:02.727Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session
2020-11-02T16:06:02.727Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platform: 'Windows 10',
      browserName: 'Chrome',
      version: '86.0',
      resolution: '1920x1080',
      name: 'LambdaTest',
      build: 'LambdaTest',
      network: false,
      video: true,
      visual: false,
      console: false
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platform: 'Windows 10',
    browserName: 'Chrome',
    version: '86.0',
    resolution: '1920x1080',
    name: 'LambdaTest',
    build: 'LambdaTest',
    network: false,
    video: true,
    visual: false,
    console: false
  }
}
[0-0] 2020-11-02T16:06:09.491Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/")
[0-0] 2020-11-02T16:06:09.492Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/url
2020-11-02T16:06:09.492Z INFO webdriver: DATA { url: 'https://mister-medicare.hatfield.marketing/' }
[0-0] 2020-11-02T16:06:11.212Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[0-0] 2020-11-02T16:06:11.212Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:11.212Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[0-0] 2020-11-02T16:06:11.313Z INFO webdriver: RESULT { ELEMENT: '0.0004651119544065718-1' }
[0-0] 2020-11-02T16:06:11.323Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:11.323Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
[0-0] 2020-11-02T16:06:11.323Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.0004651119544065718-1',
      ELEMENT: '0.0004651119544065718-1'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:11.418Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[0-0] 2020-11-02T16:06:11.418Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:11.418Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[0-0] 2020-11-02T16:06:11.588Z INFO webdriver: RESULT { ELEMENT: '0.0004651119544065718-2' }
[0-0] 2020-11-02T16:06:11.592Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:11.593Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
2020-11-02T16:06:11.593Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.0004651119544065718-2',
      ELEMENT: '0.0004651119544065718-2'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:11.691Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/dental-plans")
[0-0] 2020-11-02T16:06:11.691Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/url
2020-11-02T16:06:11.691Z INFO webdriver: DATA { url: 'https://mister-medicare.hatfield.marketing/dental-plans' }
[0-0] 2020-11-02T16:06:12.641Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[0-0] 2020-11-02T16:06:12.641Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:12.641Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[0-0] 2020-11-02T16:06:12.751Z INFO webdriver: RESULT { ELEMENT: '0.2360071775803776-1' }
[0-0] 2020-11-02T16:06:12.755Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:12.755Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
2020-11-02T16:06:12.755Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.2360071775803776-1',
      ELEMENT: '0.2360071775803776-1'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:12.998Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[0-0] 2020-11-02T16:06:12.998Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:12.999Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[0-0] 2020-11-02T16:06:13.096Z INFO webdriver: RESULT { ELEMENT: '0.2360071775803776-2' }
[0-0] 2020-11-02T16:06:13.099Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:13.099Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
2020-11-02T16:06:13.099Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.2360071775803776-2',
      ELEMENT: '0.2360071775803776-2'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:13.198Z INFO webdriver: COMMAND navigateTo("https://mister-medicare.hatfield.marketing/about-mister-medicare")
[0-0] 2020-11-02T16:06:13.199Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/url
[0-0] 2020-11-02T16:06:13.199Z INFO webdriver: DATA {
  url: 'https://mister-medicare.hatfield.marketing/about-mister-medicare'
}
[0-0] 2020-11-02T16:06:14.311Z INFO webdriver: COMMAND findElement("css selector", ".brand-logos-section")
[0-0] 2020-11-02T16:06:14.312Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:14.312Z INFO webdriver: DATA { using: 'css selector', value: '.brand-logos-section' }
[0-0] 2020-11-02T16:06:14.450Z INFO webdriver: RESULT { ELEMENT: '0.056071708552020594-1' }
[0-0] 2020-11-02T16:06:14.456Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:14.456Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
2020-11-02T16:06:14.456Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.056071708552020594-1',
      ELEMENT: '0.056071708552020594-1'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:14.646Z INFO webdriver: COMMAND findElement("css selector", ".contact-form-section")
[0-0] 2020-11-02T16:06:14.646Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/element
2020-11-02T16:06:14.646Z INFO webdriver: DATA { using: 'css selector', value: '.contact-form-section' }
[0-0] 2020-11-02T16:06:14.736Z INFO webdriver: RESULT { ELEMENT: '0.056071708552020594-2' }
[0-0] 2020-11-02T16:06:14.740Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2020-11-02T16:06:14.740Z INFO webdriver: [POST] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af/execute
2020-11-02T16:06:14.740Z INFO webdriver: DATA {
  script: 'return (function (elem, options) {\n' +
    '    elem.scrollIntoView(options);\n' +
    '  }).apply(null, arguments)',
  args: [
    {
      'element-6066-11e4-a52e-4f735466cecf': '0.056071708552020594-2',
      ELEMENT: '0.056071708552020594-2'
    },
    true
  ]
}
[0-0] 2020-11-02T16:06:14.833Z INFO @wdio/lambdatest-service: Update job with sessionId 22f67ae49fdd1ee30dc9c7e9f04435af, status: passed
[0-0] 2020-11-02T16:06:15.432Z INFO webdriver: COMMAND deleteSession()
[0-0] 2020-11-02T16:06:15.432Z INFO webdriver: [DELETE] http://hub.lambdatest.com:80/wd/hub/session/22f67ae49fdd1ee30dc9c7e9f04435af
[0-0] PASSED in Chrome - C:\Users\jeff\Documents\tools\lambdatest-webdriverio\webdriverio-selenium-sample\tests\specs\desktop_test.js
2020-11-02T16:06:15.704Z INFO @wdio/cli:launcher: Run onComplete hook

Spec Files:      2 passed, 2 total (100% completed) in 00:01:54

2020-11-02T16:06:15.708Z INFO @wdio/local-runner: Shutting down spawned worker
2020-11-02T16:06:15.960Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2020-11-02T16:06:15.962Z INFO @wdio/local-runner: shutting down

Here's my conf file:

exports.config = {
  services: [
    [
      "lambdatest",
      {
        // tunnel: true,
        lambdatestOpts: {
          logFile: "tunnel.log"
        }
      }
    ]
  ],
  user: process.env.LT_USERNAME,
  key: process.env.LT_ACCESS_KEY,
  specs: ["./tests/specs/desktop_test.js"],
  exclude: [],
  maxInstances: 10,

  // Adjust Capabilities as needed
  commonCapabilities: {
    name: 'LambdaTest',
    build: 'LambdaTest',
    network: false,
    video: true,
    visual: false,
    console: false
  },

  // Adjust Name and Build info here.
  // These are commmon capabilities used for each build you want to test
  // so we're not duplicating build info.  
  capabilities: [
     /* Firefox */
    {
      platform: "Windows 10",
      browserName: "Firefox",
      version: "82.0",
      resolution: "1920x1080"
    },
    /* Chrome */
    {
      platform: "Windows 10",
      browserName: "Chrome",
      version: "86.0",
      resolution: "1920x1080"
    },
    /* Edge */
     {
       platform: "Windows 10",
       browserName: "MicrosoftEdge",
       version: "85.0",
       resolution: "1920x1080"
     },    
  ],
  logLevel: "info",
  coloredLogs: true,
  screenshotPath: "./errorShots/",
  baseUrl: "",
  waitforTimeout: 100000,
  connectionRetryTimeout: 100000,
  connectionRetryCount: 5,
  path: "/wd/hub",
  hostname: "hub.lambdatest.com",
  port: 80,
  framework: "mocha",
  mochaOpts: {
    ui: "bdd",
  },
  urls: [
      "https://mister-medicare.hatfield.marketing/", "https://mister-medicare.hatfield.marketing/dental-plans", "https://mister-medicare.hatfield.marketing/about-mister-medicare",
  ]
};

// Code to support common capabilities
exports.config.capabilities.forEach(function(caps) {
  for (var i in exports.config.commonCapabilities)
    caps[i] = caps[i] || exports.config.commonCapabilities[i];
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.