Is it good to make separate classes for common functions (like click)

I’m making a framework and I’m concerned I’m over-engineeringĀ the thing.

They have a lotĀ of elements and common click and enters. I could just use driver.findelement(saveButton).click(), but I wanted to include a WebDriverWait for it to give a chance for the element to load/clickable if it hasn’t already. So I created common click function in the base class, but then that got cluttered so I moved them out of there into a ‘commonInteraction’ class. Then I decided that I could break it up and put click functions like ClickOn(By element) ClickOnAndWait(By element) Check(By element) Uncheck(By element), etc into there own class. All my clicks use this and they’re beginning to look like action.clickOn(saveButton), it then waits until the element is clickable and clicks. is this reasonable? What are your approaches?

Default Asked on January 24, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.