I have a Selenium test that fills out a form. I have a method for it, but this method is overgrown in terms of the number of parameters -
newMerchantPage.addEditMerchant(merchantDomain, merchantName, merchantCategory, true, merchantDescription, merchantNotes, merchantTags, true, true, false, false, merchantTitle, additionalDescription, merchantHeading, dummyCouponLink, true);
There are only lines and logical. I thought to use a collection and then iterate over the collection in the called method to do some more processing. Although not sure if this is the way to go. Any recommendations?
MODIFIED METHOD:
After doing a couple of preliminary messages, my method (of another method) looks like this:
ContactPage contactPage = new ContactPage(driver); setContactFormData(); contactPage.setName(name).setEmailAddress(emailAddress).setSubject(subject).setMโ โessage(message); contactPage.submitContactForm(contactPage);
submitContactForm, in turn, calls various utilities. How does that look bad? Especially the last line (a method call on an object and the same object passed as an argument)?
source share