Need help with automation test script using Cucumber and selenium

0 votes

Can anyone please help me with the automation test for the following requirement:

As an Admin User,
I would like to change the password of other user's accounts.
Feature: Update password
Scenario: Admin user can update the user password
   Given I am in the HR system with an Admin account
   When I update password of another user
   Then I receive a message for updating password successfully
   And user's password is updated to the new password

Please anyone suggest how to write test script for this file.

Aug 1, 2019 in Selenium by Unnati
383 views

1 answer to this question.

0 votes

Hi Unnati, you can use TestNG to write test script for your requirements. Following test script fulfills your requirements:

@test
public void testAdminUserCanUpdateUserAccountPassword() {
 // create users 
 User userAdmin = new User(UserRole.ADMIN, username, password);
 User user = new User(UserRole.VIEWER, user_username, user_password);
       
 // use Admin user to update another user password
  String message = userAdmin.updatePassword(user, user_new_password);
  
// verify password changed
  Assert.assertEquals(message, "Password changed successfully");
  Assert.assertEquals(user.getPassword(), user_new_password);
}
answered Aug 1, 2019 by Abha
• 28,120 points

Related Questions In Selenium

0 votes
1 answer

Can anyone help me with Zomato login test script using Python Selenium Webdriver?

Hi Laxmikant, if you want to write ...READ MORE

answered Jul 29, 2019 in Selenium by Anvi
• 14,170 points
1,265 views
0 votes
1 answer

Login page test script using selenium and java in Eclipse IDE

Here is an example to login to ...READ MORE

answered Apr 23, 2018 in Selenium by Meci Matt
• 9,460 points
11,528 views
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
8,476 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
7,339 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
5,086 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
6,336 views
0 votes
1 answer

Login test for Gmail with Cucumber and Selenium Webdriver

Hi Devendra, following feature-file shows the scenario ...READ MORE

answered Aug 5, 2019 in Selenium by Abha
• 28,120 points
12,074 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP