|
1 | 1 | --- |
2 | 2 | id: cucumber-script-testng-selenium |
3 | | -title: Execute Selenium Tests With Cucumber |
| 3 | +title: Run your Selenium Cucumber tests on LambdaTest |
4 | 4 | sidebar_label: Cucumber |
5 | 5 | description: Your guide to running tests using Cucumber on LambdaTest's Selenium Grid of 3000+ real devices and desktop browsers. |
6 | 6 | keywords: |
@@ -44,57 +44,45 @@ import TabItem from '@theme/TabItem'; |
44 | 44 | }) |
45 | 45 | }} |
46 | 46 | ></script> |
| 47 | +This guide walks you through the process of running Selenium Cucumber tests on LambdaTest, a cloud-based cross-browser testing platform. By following these steps, you can seamlessly execute automated tests on a wide range of browsers and operating systems using LambdaTest’s Selenium Grid. |
47 | 48 |
|
48 | | -# Selenium Cucumber Testing Tutorial |
49 | | - |
50 | | ---- |
51 | | - |
52 | | -In this topic, you will learn how to configure and run tests using **Cucumber** on LambdaTest's [Selenium testing cloud platform](https://www.lambdatest.com/selenium-automation). |
53 | | - |
54 | | -## Objectives |
55 | | - |
56 | | ---- |
57 | | - |
58 | | -By the end of this topic, you will be able to: |
| 49 | +## Prerequisites |
| 50 | +Before you begin, ensure you have the following: |
59 | 51 |
|
60 | | -1. Set up an environment for testing your hosted web pages using **Cucumber** framework with **TestNG** and **Selenium**. |
61 | | -2. Understand and configure the core capabilities required for your Selenium test suite. |
62 | | -3. Test your locally hosted pages on LambdaTest platform. |
63 | | -4. Explore advanced features of LambdaTest. |
| 52 | +- Your [LambdaTest Username and Access Key](https://accounts.lambdatest.com/) |
| 53 | +- Install Java Development Kit (JDK). We recommend Java version 11 |
| 54 | +- Install [Maven](https://maven.apache.org/) |
| 55 | +- [Download](https://www.selenium.dev/downloads/) the latest Selenium Client and its WebDriver bindings |
64 | 56 |
|
| 57 | +## Step 1: Configure your test suite |
65 | 58 | :::tip Sample repo |
| 59 | +Download or Clone the code sample for the Cucumber from the LambdaTest GitHub repository to run the tests on our Standard Grid. |
66 | 60 |
|
67 | | -All the code samples in this documentation can be found on **LambdaTest's Github Repository**. You can either download or clone the repository to quickly run your tests. <a href="https://github.com/LambdaTest/cucumber-testng-sample" className="github__anchor"><img loading="lazy" width="50" height="50" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub</a> |
68 | | - |
| 61 | +<a href="https://github.com/LambdaTest/cucumber-testng-sample" className="github__anchor" target="_blank"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub</a> |
69 | 62 | ::: |
70 | 63 |
|
71 | | -## Prerequisites |
72 | | - |
73 | | ---- |
74 | | - |
75 | | -Before you can start performing Java automation testing with Selenium, you would need to: |
76 | | - |
77 | | -- Install the latest **Java development environment**. We recommend to use **Java 11** version. |
78 | | - |
79 | | -- Download the latest **Selenium Client** and its **WebDriver bindings** from the [official website](https://www.selenium.dev/downloads/). Latest versions of Selenium Client and WebDriver are ideal for running your automation script on LambdaTest Selenium cloud grid. |
80 | | - |
81 | | -- Install **Maven**. It can be downloaded and installed following the steps from [the official website](https://maven.apache.org/). Maven can also be installed easily on **Linux/MacOS** using [**Homebrew**](https://brew.sh/) package manager. |
82 | | - |
83 | | -### Cloning Repo and Installing Dependencies |
| 64 | +```bash title="terminal" |
| 65 | +git clone https://github.com/LambdaTest/cucumber-testng-sample.git |
| 66 | +cd cucumber-testng-sample |
| 67 | +``` |
84 | 68 |
|
85 | | -**Step 1:** Clone the LambdaTest’s [cucumber-testng-sample](https://github.com/LambdaTest/cucumber-testng-sample) repository and navigate to the code directory as shown below: |
| 69 | +If you are using your own project, make sure you update the **Hub endpoint** in your tests file. By setting up the Hub endpoint, you establish the communication channel between your tests and the browser nodes, enabling effective test distribution and execution. |
86 | 70 |
|
87 | | -```bash |
88 | | -git clone https://github.com/LambdaTest/cucumber-testng-sample |
89 | | -cd cucumber-testng-sample |
| 71 | +```java title="Test.java" |
| 72 | +public static String hubURL = "https://hub.lambdatest.com/wd/hub"; |
90 | 73 | ``` |
91 | 74 |
|
92 | | -You may also want to run the command below to check for outdated dependencies. |
| 75 | +## Step 2: Update the dependencies |
| 76 | +Run the command below to check for outdated dependencies. Review updates carefully before modifying your `pom.xml`, as they might not be compatible with your code. |
93 | 77 |
|
94 | | -```bash |
| 78 | +```bash title="terminal" |
95 | 79 | mvn versions:display-dependency-updates |
96 | 80 | ``` |
97 | 81 |
|
| 82 | +```xml reference |
| 83 | +https://github.com/LambdaTest/cucumber-testng-sample/blob/master/pom.xml |
| 84 | +``` |
| 85 | + |
98 | 86 | ### Setting up your Authentication |
99 | 87 |
|
100 | 88 | Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest Selenium Grid. You can obtain these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build) or through [LambdaTest Profile](https://accounts.lambdatest.com/login). |
|
0 commit comments