Page Object Model Pattern

So I am trying to figure out a good way to handle data. I am looking to create page object model pattern in test project. I am working on an ecommerce site and I will have data for multiple customers. First name, last name, address, city state, zip, credit card #, CCV, exp date. So i want to create a test that is called by another test (Page Object). I want it to have generic parameters that I can pass this data in to say Add a new credit card or add a new shipping address. One idea i have is to store say one customer in a parameter called “Customer1” and split the string in the subtest (Page Object). Is there a better way to do this? I dont want to have to set at the beginning of each test 10-15 parameters and the associated data. Anyone encounter this yet?

Hi @perfectstorm.

Can you please give more details so I can suggest the best way to achieve that in your case?

From where do you get the customer’s data?
After getting the data, how exactly do you want to use it? Do you want to type it somewhere?

If you can share screenshots, it would be great also.

This data is custom made up data on my end. I just don’t have to hardcode it in each test.
So lets say I have 1 customer. This customer has the following attributes (Name, Address1, Address2, City, State, Zip Code, Phone, Credit Card Number, Expiration, CCV.

I would like to create a collection of tests that perform certain things like (Add shipping address, Add Credit Card etc). I do not want to hardcode this data in each test. that’s a lot of parameters and if I have to change it at one point I would have to update a bunch of tests. I would like to pass the data into these tests.

My one solution is to use a parameter to contain all this info and use string utils to split the data and use in the method

Paramter CreditCard (4111111111111111;Visa,12;2026;123)

This topic was automatically closed after 180 days. New replies are no longer allowed.