Automation Testing With Mocha And Selenium


Mocha is one of the most renowned test automation frameworks for JavaScript. It offers powerful test reporting with serial test execution for asynchronous testing, along with immense browser support. The best part is that it runs on Node.js and highlights uncaught exceptions to the appropriate test cases, making it fairly adaptable for budding automation testers.

This document will help you execute your test automation scripts using Mocha with Selenium Grid on-cloud. You will be learning about:

  • Prerequisites
  • Running your first automation test case using Mocha.
  • Parallel testing with Mocha and Selenium.
  • Running Mocha tests for locally hosted web application.

Prerequisites To Run Mocha and Selenium Testing


Important: Clone LambdaTest GitHub repository for Mocha and Selenium.

  • LambdaTest Authentication Credentials
  • You need to know your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables.

    After cloning the repository, you would need to update the *.conf.js files inside the conf/ directory with your LambdaTest Username and Access Key.

    You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button or by running the below commands in your cmd/terminal.

    • For Linux/Mac:
    • For Windows:
  • Global Dependencies
    • Make sure to install Node.js from their official website.
    • You could also install Node.js using Homebrew.

First Automation Test Case using Mocha and Selenium


After cloning the LambdaTest GitHub repository for Mocha and Selenium and configuring your LambdaTest authentication credentials in the conf.js file. You now need to simply run the below command for executing your first automation test script using Mocha and Selenium.

Parallel testing with Mocha and Selenium


With LambdaTest’s online Selenium Grid, you can execute Selenium scripts in parallel, allowing your team to shorter test cycles and faster product delivery. You could run a similar test case on multiple browser + OS combinations or you could run multiple test cases over a single browser + OS combination.

The more concurrent sessions you have, the more tests you can run in parallel. If you are confused about how many parallel sessions you may need? Don’t be! We have come up with a Concurrency Calculator that helps with an estimate of the number of concurrent sessions you need to go for!

Use the below command to run your Mocha and Selenium test cases in parallel.

Mocha & Selenium Tests for Locally Hosted Web Pages


Using Lambda Tunnel you can perform cross browser testing of your locally hosted web pages and web applications on 2000+ real browsers hosted on our cloud servers. Lambda Tunnel establishes an SSH(Secure Shell) connection between your local machine and our cloud servers.

Refer our LambdaTest Tunnel documentation for more information.

Download latest LambdaTest Tunnel binary file and extract it.

To run your Mocha automation script for locally hosted web applications on LambdaTest Selenium Grid, you would need to set the Tunnel Capability flag to true.

You can also refer to our Selenium Desired Capabilities Generator to get the Capabilties class as per your requirements without having to code yourself.

Important Note

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 the 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“.

Kudos! That is all you need to run your Mocha test scripts on LambdaTest Selenium Grid. You can view the results of your test script execution on the LambdaTest Automation Dashboard.

Got Questions?
Feel free to give us a shout on our 24/7 in-app customer chat support. You can even mail to support@lambdatest.com. Happy Testing! 🙂

Sharing Lambda Tunnel


LambdaTest is a cross browser testing tool which allows you to test your locally hosted website or web application on 2000+ real browsers. It does so with the help of an SSH(Secure Shell) tunnel which establishes a secure and unique connection from your local system to LambdaTest cloud servers.

Earlier with Lambda Tunnel, users belonging to the same organization were able to choose any tunnel they want. So if a team had 5 members and all of them had configured their own tunnels, then they were able to shuffle their SSH tunnel connection with any of the 5 connections. However, that is not the case anymore!

Now, a user can only work on a user-specific SSH tunnel connection. In case you wish to keep a common SSH tunnel connection across all your teammates then you will need to establish a shared Lambda Tunnel that would work for all of the teammates, listed under your organization at LambdaTest.

This document will help you share your Lambda Tunnel with colleagues listed as team in your LambdaTest account.

Configuring Lambda Tunnel


Step 1: Download the zip file of Lambda Tunnel for your operating system:

Step 2: Extract the zip file in your system and route your CMD/terminal to the same folder where the zip file is extracted. For demonstration purpose, we have extracted the zip file to desktop so you will find the CMD to be pointed towards the desktop.

point cmd to same folder where the zip file is stored.

Step 3: To configure a shared Lambda Tunnel you would need to append an argument -shared-tunnel to the command used for invoking Lambda Tunnel. Syntax to configure a shared SSH Lambda Tunnel would be:

So for example, if your user login email is example@lambdatest.com and your user key is 123asd123, the command would be:

command to run shared tunnel

Step 4: As you run the above command you will find the below console UI indicating with a message that the tunnel is successfully established.

shared tunnel established successfully

That is it, if your teammates will now open their LambdaTest account then they will find your Tunnel to be active for them by default.

Don’t Forget To Name The Shared Tunnel


It could be problematic if 2 or more teammates start sharing their tunnels across the organization, as a best practice we recommend you to name the Shared tunnel appropriately so your teammates could easily identify which SSH tunnel is their own and which is the one shared by you.

To name a shared tunnel you will have to append another argument in the command for configuring tunnel. The new argument would be: -tunnelName {string}

Syntax:

Example

SharedSSH-Example

Important Note: If you are running local host at a port which is different from the default port being used your team then make sure to tell them so they can address it in the URL while performing cross browser testing at LambdaTest. For example, if you are running Apache server at port 4200, and want your teammates to hop over a URL that is hosted locally by you, then they will have to specify port 4200 before they hit the start testing button on LambdaTest.

specify the port for localhost

Kudos! You have successfully created a Shared Lambda Tunnel for your organization. If you still have any questions, feel free to share them with us through our 24/7 chat support or by mailing to us on support@lambdatest.com. Happy testing! 🙂

Run Oxygen Automation Scripts On LambdaTest Selenium Grid

Oxygen is an open-source test automation framework offering a low code approach for Selenium and Appium test, meaning the scripts although based on JavaScript, look almost as plain as English, making them intuitive.

Oxygen supports LambdaTest Selenium Grid, meaning you can configure your LambdaTest account on your Oxygen instance to perform cross browser testing on 2000+ real browser running on real operating systems, on-cloud. That way you can eliminate the need for configuring in-house Selenium Grid infrastructure and run your Oxygen IDE test over a wider test coverage.

Prerequisites


  • Make sure to download the Oxygen framework for your operating system.
  • Retrieve your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You can do so by visiting the LambdaTest automation dashboard and clicking on the key icon near the help button.
  • Automation dashboard key icon

Configure LambdaTest Authentication Variables In Oxygen


Step 1: Open the Oxygen framework and click on the cloud icon on the upper-right corner.

click on the cloud-icon

Step 2: Turn on the toggle for LambdaTest to run your Oxygen automation scripts on LambdaTest Selenium Grid of 2000+ real browsers.

Toggle LambdaTest

Step 3: Once you turn the toggle on, you need to fill the mandatory fields to run your Oxygen tests on LambdaTest Selenium Grid. These mandatory fields include your Hub URL, your LambdaTest username, and your LambdaTest access key.

Hub URL, username, and access key

You can also capture browser console, network logs, screenshots, and video-recording for your Oxygen test execution over LambdaTest Selenium Grid by enabling the checkboxes. After selecting the preferred checkboxes and filling the mandatory fields, click on Save & Close.

save and close

Step 4: You will now find a drop-down beside the Run button which says Local, indicating that the tests are being executed on your Local machine. To run the tests on LambdaTest cloud, you would need to select the value for LambdaTest.

select LambdaTest from dropdown

Kudos! That is all you need to do for integrating your Oxygen framework with LambdaTest Selenium Grid. Now, as you run the test it would be executed over the Selenium Grid offered by LambdaTest which would enable you to ensure a sturdy cross browser compatible web-application.

Selenified Integration With LambdaTest


Previously known as SecureCI™ Testing Framework, Selenified is an open-source test automation framework as a wrapper to Selenium with extra features such as detailed traceable reporting, custom reporting, ability to invoke dynamic waits etc. so you could test your web-application across web and even API level. The framework is built on top of TestNG which makes it an intuitive for beginners and offers support with multiple build tools such as Maven, Gradle, and Ant, making it easier to integrate with your DevOps build environments.

With LambdaTest integration to Selenified, you can perform cross browser testing in parallel on more than 2000 real browsers available at an online Selenium Grid offered by LambdaTest. So you don’t have to worry about configuring an in-house testing infrastructure as LambdaTest will take care of that for you.

Prerequisites


  • Basic understanding of running tests from Selenified. If you haven’t run a Selenified test before, you can refer to their official GitHub repository.
  • LambdaTest Hub URL
  • LambdaTest Authentication Credentials
  • You will need your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button.

    • For Linux/Mac:
    • For Windows:

Running Selenified Tests On LambdaTest Cloud Grid


You can run your Selenified test cases on a cloud-based Selenium Grid such as LambdaTest by declaring any of the two aspects into your test automation script.

  1. Feeding a remote Hub URL.
  2. Configuring authentication credentials as the environment variables.

Hub URL

By default, your Selenified tests would be executed over a standalone server. To run your tests using a remote server for LambdaTest Selenium Grid, you will need to provide your LambdaTest HubURL.

Note: If required, you can also declare extra parameters such as a particular port or IP.

Authentication Credentials

You can also run your Selenified test automation scripts on LambdaTest Selenium Grid by simply declaring your LambdaTest authentication credentials as the environment variables in your Selenified test automation script.

Note: LambdaTest clubs your test cases under a group, and assign them under a build. If you wish to override the build name then you can do so by invoking the buildName parameter in your
Selenified script.

That is all you need to tweak to run your Selenified tests on LambdaTest Selenium Grid. In case you have any questions, feel free to share them with us in the comments or simply wave them to our 24/7 in-app customer chat support. You could also email us through support@lambdatest.com. Happy testing! 🙂

zipBoard Integration


zipBoard offers a review platform on cloud to help you collaborate with your team over a web project. You can attach an image and mention suggestions, tag your collaborators, and do more with full transparency. Using zipBoard your colleagues can view every reported bug or suggestion regarding the project, and understand who is doing what?

LambdaTest is a cross browser testing tool on a cloud which offers 2000+ real browsers and browser versions. You can perform both manual, and automated cross browser testing with an online Selenium Grid. LambdaTest integration with zipBoard will help you report bugs directly from LambdaTest to your zipBoard instance, in just a single click.

How To Integrate zipBoard With Your LambdaTest Account?


Step 1: Login to your LambdaTest account. You would need to have Admin or User level access to see and install integrations.

Step 2: Select ‘Integration’ from the left navigation menu bar. This will guide you to a screen where you will find a list of 3rd party applications, available to integrate with your LambdaTest account.

Step 3: Under the Bug Tracker category, click on the block that says ‘zipBoard’.

click zipboard under integrations

Step 4: You will be routed to a screen where you need to fill up your API key.

provide API key

Finding API Key In zipBoard

Step 1: Go to your zipBoard account and edit your profile by opening the drop-down menu from top-right corner of your screen.

edit zipboard profile

Step 2: Click on the + icon to generate your first API key if you don’t have one already.

set API key

Step 3: A prompt message would open up asking you to create a new API key. Click on Yes.

create a new API key

Note: This API key will be used to authenticate your zipBoard account with third-party applications. Make sure you don’t share it with anyone. In case you feel the API key has been misplaced then you can always regenerate a new API key from zipBoard by clicking on the refresh icon under your profile settings.

API key generated

Step 4: Copy the API key and paste it on LambdaTest to integrate with zipBoard and hit Install.

paste the API key on LambdaTest

Step 5: You have successfully integrated zipBoard with LambdaTest. If you go to integrations tab you will find a green tick over the zipBoard block, indicating the integration is successful.

successfully integrated zipBoard with LambdaTest

Logging The First Bug From LambdaTest To zipBoard


Step 1: Login to LambdaTest and perform any type of testing. In this case we will go with Screenshot testing feature under the drop-down menu for Visual UI Testing.

perform screenshot testing

Step 2: Select the browsers for which you wish to capture screenshot of your website and provide the test URL before you hit the Capture button.

select browsers and test URL

Step 3: Wait a few seconds and you will find your full-page screenshots for every configuration you selected.

select any screenshot

Step 4: Once you have the screenshots ready, click on any screenshot and highlight the bug you wish to report. After you highlight click on the mark as bug button.

mark as bug

Step 5: A form specific to zipBoard would open up. You will need to fill the details in this form before you create the issue. Doing so will directly mark a bug into your zipBoard instance.

You can attach the below details with the screenshot:

  • Project
  • Assignee
  • Task Status
  • Task Priority
  • Task Type
  • Task Name
  • Description

create the issue

Every detail you provide at LambdaTest will automatically be reflected in the zipBoard task.

Note: After you click on “Create Bug”, you will be able to observe it being successfully marked through a single click effort. You will get prompt messages on top of your Virtual Machine indicating the progress of bug logging. After few seconds you will be notified with a prompt message “Bug successfully marked” indicating that the screenshot has been pushed to your zipBoard project.

Step 6: If you visit your respective Project on zipBoard, you will find a new task created under it.

go to new task in zipBoard

Step 7: Open tasks of the Project and you will find the bug marked from LambdaTest with all the information you specified while your performed cross browser testing.

open the task in zipBoard

Step 8: Click on the task and you can also find the URL to the screenshot you highlighted at LambdaTest along with the test environment details.

find the image URL in the task

Remove LambdaTest Integration With zipBoard

You can work with one integration at a time. So if you would want to integrate to a similar 3rd party application, then you would have to remove your current integration. Here is how you can do that.

Go to LambdaTest application and hit the Integrations tab. Under the block for zipBoard you will find the option to REMOVE the integration.

remove LambdaTest integration with zipBoard

That was all you need to know for LambdaTest + zipBoard Integration. Increase your productivity with our integrations. If you still have any questions for us, please feel free to let us know. Our experts are always available on chat to help you out with any roadblock regarding our product. Happy testing! 🙂

Applitools Integration With LambdaTest


Applitools offers a cloud-based platform to help you perform AI powered, end-to-end visual testing, and monitoring. The platform is designed to make life easier for automation testers by delivering a flexible way to integrate their test scripts directly, without worrying about learning a new language or creating a new automation script.

LambdaTest integration with Applitools will help you perform automated cross browser testing on more than 2000 real browsers running on real operating systems, hosted on a cloud-based Selenium Grid. You can execute your automation test script on LambdaTest Selenium Grid directly from your Applitools instance.

In this topic, you will learn about the:

  • Prerequisites for integrating LambdaTest with Applitools.
  • Running your first test on LambdaTest Selenium Grid from Applitools.
  • Test your locally hosted applications on LambdaTest from Applitools.

Prerequisites To Integrate LambdaTest With Applitools


  • LambdaTest Authentication Credentials
  • Be aware of your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button.

    • For Linux/Mac:
    • For Windows:
  • Applitools API Key
  • You can find your Applitools API key by logging into your Applitools account and going to your Profile > My API Key.
    In your terminal or CMD, you need to export the Applitools API key along with LambdaTest Credentials.

    • For Linux/Mac:
    • For Windows:
  • Global Dependencies
    • Make sure you have Java installed in your operating system.
    • Download and install Maven Apache.
  • Install Maven dependencies using the below command.

Run Your First Test On LambdaTest Selenium Grid From Applitools


Below is a code to run a demo test on LambdaTest Selenium Grid from Applitools.

Important: You can clone the below code from our GitHub repository for LambdaTest Integration with Applitools.

Once you have cloned the above code, you need to execute the below command to trigger the test on LambdaTest Selenium Grid.

Watch the execution of the demo test on LambdaTest Automation Dashboard.

Test Your Locally Hosted Applications On LambdaTest From Applitools


You can test your locally hosted or privately hosted projects with LambdaTest Selenium grid cloud using Lambda Tunnel app. All you would have to do is set up an SSH tunnel using Lambda Tunnel app, and pass toggle tunnel = True via desired capabilities. Lambda Tunnel establishes a secure SSH protocol based tunnel that allows you in testing your locally hosted or privately hosted pages, even before they are made live.

Refer our LambdaTest Tunnel documentation for more information.

Download latest LambdaTest Tunnel binary file and extract it.

To run your Applitools automation script for locally hosted web applications on LambdaTest Selenium Grid, you would need to set the Tunnel Capability flag to true.

Important Note:

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”.

Got Questions?
Feel free to give us a shout on our 24/7 in-app customer chat support. You can even mail to support@lambdatest.com. Happy Testing! 🙂

ClickUp Integration


ClickUp offers a highly customizable cloud-based platform to boost your productivity for both professional and personal life by storing all of your tasks, docs, conversations, timelines, spreadsheets, and more in a single place. You can have different views of the project such as Gantt view, board view, and calendar view. You could also chat with your colleagues, and share documents with the team. ClickUp also offers numerous features for time management, task management, project management, along with effective collaboration, reporting, and integrations to third-party tools such as LambdaTest.

LambdaTest integration with ClickUp will help you report bugs and UI anomalies directly in your desired project on ClickUp while performing cross browser testing with LambdaTest. You can capture a screenshot of the bug, highlight the anomaly, annotate extra information, choose an assignee, provide a suitable title and description to help relay further actions. You can do all that directly from LambdaTest, in just a single click.

How To Integrate ClickUp With Your LambdaTest Account?


Step 1: Login to your LambdaTest account. You would need to have Admin or User level access to see and install integrations.

Step 2: Select ‘Integration’ from the left navigation menu bar. This will guide you to a screen where you will find a list of 3rd party applications, available to integrate with your LambdaTest account.

Step 3: Click on the block that says ‘ClickUp’.

select ClickUp integration in LambdaTest

Step 4: After you click on the ClickUp icon, you will need to authenticate LambdaTest API with your ClickUp account. If you are not logged into your ClickUp account, then you will be asked to do so for successfully authenticating you ClickUp account with LambdaTest.

Log in to ClickUp

Note: If you are already logged into your ClickUp account, you will be redirected to the ClickUp instance for authenticating the LambdaTest APIs to fetch necessary details from your ClickUp account.

Authenticate LambdaTest To ClickUp

Step 5: After authentication of your ClickUp account, you will be redirected back into LambdaTest application where you will notice a prompt message indicating that you have successfully integrated your LambdaTest account with your ClickUp instance. You will also notice a green tick and a refresh icon. The refresh button will help you synchronize your ClickUp account with LambdaTest in just a single click.

ClickUp successfully integrated

Log Your First Bug Through LambdaTest Integration With ClickUp


Step 1: Go for any of the test from the left navigation menu. For demo, we will be taking “Real Time Test” option.

Step 2: Present a URL of the web-app you need to test in the dialog box. After that, select any configuration for browser and operating system of your choice & hit ‘Start‘.

Real time test on LambdaTest

Step 3: After the VM is launched and operable. You can perform testing on your web-app for finding bugs. If a bug gets revealed, then you need to click on the Bug icon from the left panel for capturing a screenshot of the same. We have highlighted that option with yellow in the below image.

Click on bug icon to mark a bug

Step 4: After a screenshot is captured, you can annotate any issue or a task with an in-built image editor. Once you are done highlighting the bug, click on the button that says “Mark as Bug”.

click mark as bug

Step 5: After clicking on “Mark as Bug” button a form specific to ClickUp would open up. Fill the fields as per your requirement, and create the issue.

  • You can select the Team you wish to assign the bug.
  • Specify the Space on which you wish to log the bug.
  • Choose a particular Project.
  • Determine the List on which you wish to involve the UI bug/suggestion.
  • Set a Status for the task.
  • Assign it to a colleague.
  • Provide a task name.
  • A relevent Description about the UI observation.

create an issue with relevant details
Note: After you click on “Create Bug”, you will be able to observe it being successfully marked through a single click effort. You will get prompt messages on top of your Virtual Machine indicating the progress of bug logging. After few seconds you will be notified with a prompt message “Bug successfully marked” indicating that the screenshot has been pushed to your ClickUp project.

LambdaTest & Microsoft Teams Integration

Step 6: Now, go to your ClickUp project and you will notice your logged task under the specific project that you assigned it through LambdaTest.

bug marked on ClickUp account

Step 7: Click on the logged task and you will find all the details about the bug that you stated while marking the bug from LambdaTest. You will also find a URL that would route you to the particular screenshot that was logged while creating the issue from LambdaTest.

Find bug details in the ClickUp task

Remove LambdaTest Integration With ClickUp


You can work with one integration at a time. So if you would want to integrate to a similar 3rd party application, then you would have to remove your current integration. Here is how you can do that.

Step 1: Login to your LambdaTest account.

Step 2: Select ‘Integrations’ from the left-navigation menu. This will guide you to a screen where you will find 3rd party applications, available to integrate with your LambdaTest account.

Step 3: Click on ‘REMOVE’. You can find the remove button under the ‘ClickUp’ block which would be highlighted with a green tick.

Remove ClickUp Integration

That was all you need to know for LambdaTest + ClickUp Integration. Increase your productivity with our integrations. If you still have any questions for us, please feel free to let us know. Our experts are always available on chat to help you out with any roadblock regarding our product. Happy testing! 🙂

HTTP Basic Authentication


HTTP basic authentication represents a mechanism of challenge and response to help the server make a request authentication from a client, passing the User ID and password in the URL as the standard HTTP “Authorization” header. For example: https://username:password@www.example.com/example-page.php

Browser Support For HTTP Basic Authentication


HTTP authentication is incompatible among the majority of the web browser. It is supported by only Google Chrome and Mozilla Firefox.

Browser
Support for Basic HTTP Authentication

Google Chrome

Supported

Mozilla Firefox

Although supported, Mozilla Firefox may throw a prompt confirmation. Mozilla Firefox performs a check to evaluate whether basic HTTP authentication is mandatory to access the website. In cases, where it isn’t necessary, Firefox will throw a similar warning: “You are about to log in to the site “www.example.com” with the username “username”, but the website does not require authentication. This may be an attempt to trick you.” For more information, refer to the MDN document.

Safari

Unsupported

Edge

Unsupported

Internet Explorer

Unsupported

Taking Screenshots of Pages Behind Login


LambdaTest offers Screenshot testing, a feature to automatically capture bulk, full-paged screenshots of any URL over different browsers. You can perform cross browser compatibility testing on both mobile, and desktop browsers at the same time. Also, you can capture up to 25 screenshots in a single test session.

This document will help you understand how you can capture bulk screenshots of your web-application, after the login page, for different browsers to measure the cross browser compatibility. Refer to our Automated Screenshot testing document to know more.

Understanding The Basics Of Login Profile


In order to capture screenshots after the login page of your website, you are required to configure a login profile in your LambdaTest account. This login profile will help you store the values for respective login fields such as ID, E-mail, along with the submit button using the Locators.

What are locators?
Locators are used to find HTML elements of a web page in your automation test script. Selenium offers 8 locators to help you identify the particular HTML element you are looking for:

  1. ID
  2. Name
  3. TagName
  4. CSS Selector
  5. XPath
  6. Class Name
  7. Link Text
  8. Partial Link Text

How This Works?

A Login URL is feeded into the browser. This URL is going to be the one pointing towards the login page of the website your wish to test, and would be different from the Screenshot Test URL.

Then the locators(Username, Password, Submit button) specified by you for your login page are searched by the Screenshot driver. If all fields are correct your test will pass onto next stage, if fields are incorrect then the test is marked as fail.

Now, the form gets submitted and your browser will wait for the new page to render.

Finally, the Screenshot test URL is fed into the Screenshot driver, allowing it to start generating automated screenshots in bulk, on your desired test configurations.

Note: We recommend using your Login profile for a single test session before attempting multiple screenshots for cross browser testing.

Getting Started With Automated Screenshot After Login


To begin, we need to configure a login profile which would specify the website under test, locators, and login credentials. This is a one-time process. Without further ado, let’s configure the Login profile.

Login in to your LambdaTest account and go to Screenshot by clicking on the drop down for Visual UI testing from the left-navigation menu.

go to screenshot in Visual UI testing

Set Up Login Profile

Configure the Login profile by clicking on the Login button and selecting a New Login+.

click on login and select new login+

Provide The Login URL

A window would pop-up where you need to fill the details, starting from the Login URL. Kindly ensure that you provide the URL of the login page for the website under test. Now, hit next.

enter login URL

Provide The Locators

Select the locator as per your respective fields in the Login form.

selenium locators

For demonstration, let us capture the details for LambdaTest Login.

Note: If you are already logged in to LambdaTest, make sure to perform this drill in the incognito mode.

Step 1: Go to https://accounts.lambdatest.com/login. Right-click and select the option to open the inspection tools. For demonstration, we are using the Google Chrome’s Dev Tools.

inspect dev tools

Step 2: Click on the highlighted arrow to help you select any element on your page to inspect.

select an element on the page to inspect

Step 3: Now, click on the Email field in the login form and you will notice that the name locator is populated with the value ’email’.

email field

Step 4: Switch to your normal browser where you are logged into the LambdaTest application. Provide the Email field details in the Username Locators.

provide the username locator

Step 5: Switch back to incognito mode and inspect the password field in the LambdaTest login form.

inspect the password field

Step 6: Provide the Password field details in the Password Locators.

provide the password details

Step 7: Back to incognito mode, and inspect the Login button. Perform a right click on the piece of code highlighted for login button, go to copy, and click copy XPath.

login button details

Note: In the above demonstration, you will find the class name placed for the login button in the LambdaTest login. However, class name may be similar for multiple HTML elements located in a login form, so it is considered a best practice to copy the XPath for such scenarios.

Step 8: Now, on your normal browser, Select the XPath locator and paste the copied XPath for the Login button locator and hit next.

provide login button locator

Provide The Login Credentials

Under the credentials, provide your login details for the website you wish to test and hit next. For a demonstration, you can provide your LambdaTest login details.

login credentials

Save The Login Profile

When you are done configuring the Login URL, Locators, and Credentials for your web-application under test, you only need to provide a name to save this login profile.

save login profile

Once you hit the save button, you will find the below prompt indicating that the profile has been successfully created.

profile created

Kudos, you have successfully configured the Login profile. This profile will be saved in your LambdaTest account so the next time you need to run a similar test then all you would need is to enable the flag for this Login profile.

enable login profile

Running Automated Screenshot After The Login Page


Step 1: Login to LambdaTest and go to Screenshot Testing. Enable the flag for the profile you wish to test.

enable login profile

Step 2: Now, enter the Screenshot Test URL and hit the capture button. To carry out the above demonstration, we are making use of the Test URL: https://integrations.lambdatest.com/

provide screenshot test URL

Step 3: You will find all the screenshots generated for the web page that is accessible after login.

output for screenshot after login page in LambdaTest application.

Let us know in case you have any questions, drop us an email to support@lambdatest.com or simply give us a shout. We are here to help you speed your test suites 24/7. Happy testing! 🙂

Running Cucumber Scripts With TestNG And Selenium


LambdaTest Selenium Automation Grid is a cloud-based scalable Selenium testing platform which enables you to run your automation scripts on 2000+ different browsers and operating systems. You can now run your Cucumber scripts with TestNG and Selenium for automating your web application over a scalable Selenium infrastructure that is running real browsers and real operating systems.

This post will help you in getting started with configuring and running your Cucumber Java automation test scripts on LambdaTest Selenium cloud platform. In this post we would be exploring:

  • Prerequisites and Environment Setup.
  • Running your first Cucumber Java test.
  • Running your Cucumber scripts on locally hosted web application.

Prerequisites


Visit our GitHub repository for Cucumber and TestNG for finding all the relevant code samples.
  1. Global Dependencies
    • Make sure you have the latest Java installed in your system. For Windows, you can install it from their official website by clicking here.
    • For Linux, execute the following command in terminal.
    • For Mac, Java is installed by default on Mac OS X.
    • Install Maven from their official website. You could also use the below command for Homebrew.

  2. LambdaTest Authentication Credentials
  3. Be aware of your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button.

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

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

  4. Environment Setup
    • Ensure that the necessary packages are available by running the below command.
    • You may also want to run the command below to check for outdated dependencies. Please be sure to verify and review updates before editing your pom.xml file as they may not be compatible with your code.

Running Your First Cucumber Script For TestNG and Selenium


Here is the sample feature file for Cucumber.

Here is the TestRunner file to automate our feature file through Selenium using TestNG.

Below are the step definitions.

Open your cmd/terminal and route the pointer to Cucumber-TestNG-Sample.

Testing Locally Hosted or Privately Hosted Projects


You can test your locally hosted or privately hosted projects with LambdaTest Selenium grid cloud using Lambda Tunnel app. All you would have to do is set up an SSH tunnel using Lambda Tunnel app, and pass toggle tunnel = True via desired capabilities. Lambda Tunnel establishes a secure SSH protocol based tunnel that allows you in testing your locally hosted or privately hosted pages, even before they are made live.

Refer our LambdaTest Tunnel documentation for more information.

Here’s how you can establish Lambda Tunnel.

Download latest LambdaTest Tunnel binary file and extract it.

To run your Cucumber tests for locally hosted web applications you would need to set the Tunnel Capability flag to true

Important Note:

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”.