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

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:

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,060 points

Related Questions In Selenium

0 votes
1 answer
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
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
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
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
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
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,060 points