From 68c8d1a13829c1a4a0f8833642f95b44e3ed2f55 Mon Sep 17 00:00:00 2001 From: amanchopra1905 Date: Tue, 4 Feb 2025 17:56:01 +0530 Subject: [PATCH] updating cucumber - seleniu, --- docs/cucumber-script-testng-selenium.md | 62 ++++++++++--------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/docs/cucumber-script-testng-selenium.md b/docs/cucumber-script-testng-selenium.md index 858c51750..49bb28cdf 100644 --- a/docs/cucumber-script-testng-selenium.md +++ b/docs/cucumber-script-testng-selenium.md @@ -1,6 +1,6 @@ --- id: cucumber-script-testng-selenium -title: Execute Selenium Tests With Cucumber +title: Run your Selenium Cucumber tests on LambdaTest sidebar_label: Cucumber description: Your guide to running tests using Cucumber on LambdaTest's Selenium Grid of 3000+ real devices and desktop browsers. keywords: @@ -44,57 +44,45 @@ import TabItem from '@theme/TabItem'; }) }} > +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. -# Selenium Cucumber Testing Tutorial - ---- - -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). - -## Objectives - ---- - -By the end of this topic, you will be able to: +## Prerequisites +Before you begin, ensure you have the following: -1. Set up an environment for testing your hosted web pages using **Cucumber** framework with **TestNG** and **Selenium**. -2. Understand and configure the core capabilities required for your Selenium test suite. -3. Test your locally hosted pages on LambdaTest platform. -4. Explore advanced features of LambdaTest. +- Your [LambdaTest Username and Access Key](https://accounts.lambdatest.com/) +- Install Java Development Kit (JDK). We recommend Java version 11 +- Install [Maven](https://maven.apache.org/) +- [Download](https://www.selenium.dev/downloads/) the latest Selenium Client and its WebDriver bindings +## Step 1: Configure your test suite :::tip Sample repo +Download or Clone the code sample for the Cucumber from the LambdaTest GitHub repository to run the tests on our Standard Grid. -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. Image View on GitHub - +Image View on GitHub ::: -## Prerequisites - ---- - -Before you can start performing Java automation testing with Selenium, you would need to: - -- Install the latest **Java development environment**. We recommend to use **Java 11** version. - -- 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. - -- 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. - -### Cloning Repo and Installing Dependencies +```bash title="terminal" +git clone https://github.com/LambdaTest/cucumber-testng-sample.git +cd cucumber-testng-sample +``` -**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: +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. -```bash -git clone https://github.com/LambdaTest/cucumber-testng-sample -cd cucumber-testng-sample +```java title="Test.java" +public static String hubURL = "https://hub.lambdatest.com/wd/hub"; ``` -You may also want to run the command below to check for outdated dependencies. +## Step 2: Update the dependencies +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. -```bash +```bash title="terminal" mvn versions:display-dependency-updates ``` +```xml reference +https://github.com/LambdaTest/cucumber-testng-sample/blob/master/pom.xml +``` + ### Setting up your Authentication 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).