I need to test a login form using selenium. The step checks by inputting various combination of the username and password. For eg. . I have used TestNG to perform the test. Is there any other approach that can be used or this is will be fine. Can POM be used for the purpose?
Asked
Active
Viewed 58 times
-1

Humera Shaikh
- 13
- 5
1 Answers
2
I suggest you to use Cucumber framework with Selenium so that you can define Scenario Outlines including different username and password variations. Here is an example:
Scenario Outline: Sample Scenario: New user onboarding
Given user navigates to blog page
When user clicks "New"
Then user should proceed "Onboarding" screen
Then user enters "<SampleUserName>" to "Mail" area
And user enters "<SamplePw>" to "Mail" area
And user clicks "Submit"
Examples:
| SampleInValidMail | SamplePw |
| @example.com | pw1 |
| #@%^%#$@#$@#.com | pw2 |
| \Joe Smith <email@example.com> | pw3 |
| email.example.com | pw4 |

Beytullah uzun
- 46
- 2
-
Thanks for the suggestion. I had forgotten about this. – Humera Shaikh Nov 26 '20 at 07:36