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
• 2,036 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,140 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,150 points
• 3,509 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
• 16,050 views
0 votes
1 answer

Please help me with automation script for testing Carousel Rotation with Selenium Webdriver.

Hey Hussain, you can use following lines ...READ MORE

answered Aug 14, 2019 in Selenium by Abha
• 28,140 points

edited Jul 19, 2023 by Khan Sarfaraz • 6,697 views