PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, April 21, 2022

[FIXED] How to use javascript to run automated tests in browser using selenium+CUCUMBER

 April 21, 2022     connection, cucumber, javascript, selenium, testing     No comments   

Issue

Well, I am kinda new to this. First of all, my main goal is to execute a simple cucumber example which tests automatically something extremely simple as well.By doing this I will try to get the idea of how should i do other kind of autmated test. So, I wrote some scenarios, and I want to test them somehow on a site(e.g. google.com). The site is written in JS and therefore I need to write JavaScript code to "connect" the scenarios with the language.

I google searched things like: "How to automatically test a site using cucumber" "How to automatically run scenarios with selenium-javascript" and so on...

Any ideas? No hatefull comments please :/ Thanks in advance!

DL.


Solution

I wrote some scenarios,

When you say that I believe you are able to execute your testcases with cucumber

The site is written in JS and therefore I need to write JavaScript code to "connect" the scenarios with the language.

thats not necessary, if you are site is based on javascript like AngularJS you can still use simple java + selenium but protractor is recommended for same as it have wrapper. protractor is a nodejs based project to deal with sites based on AngularJS.

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

How to automatically test a site using cucumber

You can use a CI/CD tool like jenkins which you can trigger manually or you can put an scheduler who will run all your test script against your website on it. You can also turn on the notification so when ever the test complete it will shoot an email to respective individuals

Refer:

https://jenkins.io/

You can get n number of tutorial regarding same. example:

Click Here



Answered By - Shubham Jain
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing