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
978 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
2,150 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
13,909 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 4,992 views
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
13,776 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
9,191 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,910 points
7,267 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
7,904 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,140 points
19,197 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP