Running automated tests using Selenium and Cucumber with JavaScript in a web browser

Hello there! I'm fairly new to this whole process. My primary goal right now is to successfully run a basic cucumber example that can automate a simple task. This will help me understand how to expand my automated testing skills to more complex scenarios. I've already written some test scenarios and now I want to run them on a website, such as google.com, which is built in JavaScript. As a result, I need to write JavaScript code to link these scenarios to the site's language.

I've been searching online for information on topics like "How to automate website testing with cucumber" and "How to run scenarios automatically using selenium-javascript".

Any suggestions or advice would be greatly appreciated! Please keep it positive and constructive. Thanks in advance!

DL.

Answer №1

I crafted a few potential scenarios,

If you mention that, I believe you have the capability to run your testcases using cucumber

The website is coded in JS, so I have to write JavaScript code to link the scenarios with the language.

However, it's not mandatory. If your site is JavaScript-based like AngularJS, you can still use simple Java + Selenium, although protractor is recommended due to its wrapper. Protractor is a nodejs-based project designed for AngularJS-based sites.

https://www.protractortest.org/#/

How to automate testing of a site using cucumber

You can utilize a CI/CD tool such as Jenkins, which you can manually trigger or set up a scheduler to run all your test scripts against your website. You can also enable notifications so that once the test is completed, it will send an email to the relevant individuals.

Check out:

You can find numerous tutorials on the same topic. For instance:

Click Here

Answer №2

If you're looking to delve into the world of testing with Cucumber, I recommend spending some time exploring and working through their introduction tutorial in a language that you are comfortable with. Additionally, I suggest delving into more extensive reading starting from that site, possibly beginning with

When it comes to using Cucumber for testing, it's best to focus on testing something you are actively building. Testing third-party services like Google can actually complicate matters as it involves interacting with external systems.

Understanding Cucumber can be challenging initially, and many individuals face difficulties starting out. It's important to take your time and learn from the experts behind Cucumber. Visiting cucumber.io is a more valuable starting point compared to seeking answers on StackOverflow.

Best of luck on your Cucumber journey, and happy testing!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Creating printable reports using Jspdf with data from SlickGrid

Has anyone successfully used JsPdf with a slickgrid on a webpage? I am currently using their HTML renderer, but I know it's still in early stages. I have added the HTML2Canvas cdn, but I'm unsure how to implement it. Here is my Fiddle $(docum ...

Getting the chosen option from a changing radio button

My radio button code looks like this: <span><input onClick="if (EventHandlers.valueChanged(event, this)==false) return false;" class="radio" label="Temp label" type="radio" id="TempId_01" onblur="EventHandlers.onBlur(event)" ...

How can I change the nested Material UI component style from its parent component?

I am currently incorporating a component from an external library into my project. However, I am facing limitations in customizing its style, especially when it comes to a button that is using material ui styles. Upon inspecting the element, I can see that ...

Angular - the utilization of expressions in view templates

Exploring Angular for the first time and attempting to create a Single Page Application (SPA). I have included the route module, which seems to be functioning properly. However, the templates are not interpreting Angular expressions as expected - for examp ...

JavaScript: Display all global variables on Internet Explorer

Is there a way to retrieve the instance name of my class without passing it as a parameter? I have tried looping through all global objects and comparing them with the this pointer. This method works in Chrome and Firefox, but not in Internet Explo ...

Determine the quantity of items sharing a common color (CSS attribute)

Can you help me find out the number of web elements in the list "bElements" that have a CSS Color property of "rgba(46, 162, 236, 1)"? I have provided some code below that seems to work, but I'm wondering if there is a more efficient way to achieve th ...

Issue with Vue-Validator form validation not functioning properly on JS Fiddle

I'm having trouble with vue-validator on JSFiddle. Can someone please assist in troubleshooting the issue so I can proceed with my main question? Check out JSFiddle Html: <div id="app"> <validator name="instanceForm"> & ...

Issue with breakpoints functionality in MUI v5 and React project

I've been attempting to utilize breakpoints for responsive design on my website, but unfortunately, it doesn't seem to be working correctly. Every time I implement a breakpoint, the entire page goes blank. Below is the code snippet I am working w ...

What is the proper way to declare a Type for a JSX attribute in Google AMP that utilizes square brackets?

When utilizing AMP's binding feature, you must apply specific attributes that encapsulate an element's property with square brackets and connect it to an expression. An example from AMP is shown below: <p [text]="'Hello ' + foo"> ...

What causes the malfunction of the save function in express?

Today marks my first venture into using Express. I attempted to create a straightforward route, but unfortunately, my save function is not cooperating. Despite scouring similar inquiries on stackoverflow, I have been unable to find a solution. Any assistan ...

Issue with using Bootstrap-select in conjunction with HTMX partials

I'm currently experimenting with using Bootstrap-select alongside HTMX partials in my Django project. When a specific element is modified, HTMX returns a partial HTML that includes only a dropdown menu, like this: <select id="myDropdown" ...

Exploring the Power of Nuxt's asyncData Feature for Handling Multiple Requests

Within my application, there is a seller page showcasing products listed by the specific seller. Utilizing asyncData to retrieve all necessary data for this page has been beneficial in terms of SEO. asyncData ({params, app, error }) { return app.$axi ...

Selenium: Capture an image of the current appearance of a webpage

I've been exploring ways to utilize selenium web driver in order to capture a screenshot of a webpage. The outcome is showing great promise. My only issue lies in the fact that all the examples I have come across (such as Take a screenshot with Seleni ...

Is there a way to convert time measurements like minutes, hours, or days into seconds in React and then pass that information to an

Currently, I am working on an application that allows users to select a frequency unit (like seconds, minutes, hours, or days) and input the corresponding value. The challenge arises when I need to convert this value into seconds before sending it to the ...

Having difficulty retrieving an item from a knockout observable array

When fetching data from a web API and pushing it into an observable array, I wanted to make the items in the array observable as well. Unfortunately, I found that I couldn't access the object if I made it observable. function UpdateViewModel() { ...

The text fields keep duplicating when the checkbox is unchecked

There are check boxes for Firstname, Lastname, and Email. Clicking on a checkbox should display the corresponding input type, and unchecking it should remove the input field. I am also attempting to retrieve the label of the selected checkbox without succ ...

Where should I place an object on an NFT marker using A-Frame and AR.JS?

Struggling to find a solution for aligning the video element correctly within the NFT marker area after exploring AR.JS and AFRAME documentation without success. The issue: The positioning of the video varies on different devices with varying screen and c ...

Issue: ReactJS + MaterialUI + TypeScript - Property 'component' does not exist?Possible error in ReactJS: component property is

Currently, I am designing my own custom typography. However, I have encountered an error while implementing it. I have been referring to the following documentation: https://mui.com/material-ui/api/typography/ Here is the code snippet that I am using: h ...

Can a div with float: left; be centered?

Currently, I am attempting to create a dock (similar to the iOS dock) for my website. Below is the full code that I have implemented: function addPrevClass(e) { var target = e.target; if (target.getAttribute('src')) { // check if it is img ...

Encountered issue #98123: Failed to generate development JavaScript bundle during `gatsby develop` using Webpack

To set up a new Gatsby starter blog, I executed the following commands: gatsby new blog https://github.com/alxshelepenok/gatsby-starter-lumen cd blog gatsby develop However, while running gatsby develop, I encountered numerous errors labeled as ERROR # ...