|
1 |
| -# Webdriverio Selenium Sample: Version 4.14.2 |
2 |
| -[WebdriverIO](http://webdriver.io/) Integration with LambdaTest |
3 |
| - |
4 |
| - |
5 |
| - |
6 |
| -<img src = "https://webdriver.io/img/webdriverio.png" height = "100"> |
7 |
| - |
8 |
| -## Environment Setup |
9 |
| - |
10 |
| -1. Global Dependencies |
11 |
| - * Install [Node.js](https://nodejs.org/en/) |
12 |
| - * Or Install Node.js with [Homebrew](http://brew.sh/) |
13 |
| - ``` |
14 |
| - $ brew install node |
15 |
| - ``` |
16 |
| -2. LambdaTest Credentials |
17 |
| - * Set LambdaTest username and access key in environment variables. It can be obtained from [LambdaTest dashboard](https://automation.lambdatest.com/) |
18 |
| - example: |
19 |
| - - For linux/mac |
20 |
| - ``` |
21 |
| - export LT_USERNAME="YOUR_USERNAME" |
22 |
| - export LT_ACCESS_KEY="YOUR ACCESS KEY" |
23 |
| -
|
24 |
| - ``` |
25 |
| - - For Windows |
26 |
| - ``` |
27 |
| - set LT_USERNAME="YOUR_USERNAME" |
28 |
| - set LT_ACCESS_KEY="YOUR ACCESS KEY" |
29 |
| -
|
30 |
| - ``` |
31 |
| -3. Setup |
32 |
| - * Clone the repo |
33 |
| - * Install dependencies `npm install` |
34 |
| - * Update `*.conf.js` files inside the `conf/` directory with your LambdaTest Username and Access Key |
35 |
| -
|
36 |
| -## Running your tests |
37 |
| -- To run a single test, run `npm run single` |
38 |
| -- To run local tests, run `npm run local` |
39 |
| -- To run parallel tests, run `npm run parallel` |
40 |
| -
|
41 |
| - Know how many concurrent sessions needed by using our [Concurrency Test Calculator](https://www.lambdatest.com/concurrency-calculator?ref=github) |
| 1 | +# WebdriverIO Selenium Tutorial: Version 4.14.2 |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. Install npm. |
| 8 | + |
| 9 | +``` |
| 10 | +sudo apt install npm |
| 11 | +``` |
| 12 | + |
| 13 | +2. Install NodeJS. |
| 14 | + |
| 15 | +``` |
| 16 | +sudo apt install nodejs |
| 17 | +``` |
| 18 | + |
| 19 | +## Steps to Run your First Test |
| 20 | + |
| 21 | +Step 1. Clone the Webdriverio Selenium Repository. |
| 22 | + |
| 23 | +``` |
| 24 | +git clone https://github.com/LambdaTest/webdriverio-selenium |
| 25 | +``` |
| 26 | + |
| 27 | +Step 2. Inside Webdriverio Selenium sample, export the Lambda-test Credentials. You can get these from your automation dashboard. |
| 28 | + |
| 29 | +<p align="center"> |
| 30 | + <b>For Linux/macOS:</b> |
| 31 | + |
| 32 | +``` |
| 33 | +export LT_USERNAME="YOUR_USERNAME" |
| 34 | +export LT_ACCESS_KEY="YOUR ACCESS KEY" |
| 35 | +``` |
| 36 | + |
| 37 | +<p align="center"> |
| 38 | + <b>For Windows:</b> |
| 39 | + |
| 40 | +``` |
| 41 | +set LT_USERNAME="YOUR_USERNAME" |
| 42 | +set LT_ACCESS_KEY="YOUR ACCESS KEY" |
| 43 | +``` |
| 44 | + |
| 45 | +Step 3. Inside webdriverio-selenium folder install necessary packages. |
| 46 | + |
| 47 | +``` |
| 48 | +cd webdriverio-selenium |
| 49 | +npm i |
| 50 | +``` |
| 51 | + |
| 52 | +Step 4. To run your First Test. |
| 53 | + |
| 54 | +``` |
| 55 | +npm run single |
| 56 | +``` |
| 57 | + |
| 58 | +## See the Results |
| 59 | + |
| 60 | +You can check your test results on the [Automation Dashboard](https://automation.lambdatest.com/build). |
| 61 | + |
| 62 | + |
| 63 | +## Executing Webdriverio test Parallely. |
| 64 | + |
| 65 | +1. Will use the same test script over different configration to demonstarte parallel testing. Parallel testing with webdriverio will help you to run multiple test cases simultaneously. |
| 66 | + |
| 67 | +``` |
| 68 | +npm run parallel |
| 69 | +``` |
42 | 70 |
|
43 | 71 | ### Routing traffic through your local machine
|
44 | 72 | - Set tunnel value to `true` in test capabilities
|
|
47 | 75 | > - [Mac](https://www.lambdatest.com/support/docs/display/TD/Local+Testing+For+MacOS)
|
48 | 76 | > - [Linux](https://www.lambdatest.com/support/docs/display/TD/Local+Testing+For+Linux)
|
49 | 77 |
|
| 78 | +### Run test locally |
| 79 | +``` |
| 80 | +npm run local |
| 81 | +``` |
50 | 82 | ### Important Note:
|
51 | 83 | Some Safari & IE browsers, doesn't support automatic resolution of the URL string "localhost". Therefore if you test on URLs like "http://localhost/" or "http://localhost:8080" etc, you would get an error in these browsers. A possible solution is to use "localhost.lambdatest.com" or replace the string "localhost" with machine IP address. For example if you wanted to test "http://localhost/dashboard" or, and your machine IP is 192.168.2.6 you can instead test on "http://192.168.2.6/dashboard" or "http://localhost.lambdatest.com/dashboard".
|
52 | 84 |
|
|
60 | 92 | ## Resources
|
61 | 93 | ### [SeleniumHQ Documentation](http://www.seleniumhq.org/docs/)
|
62 | 94 | ### [WebdriverIO Documentation](https://webdriver.io/docs/gettingstarted.html)
|
| 95 | + |
0 commit comments