Skip to content
CodeKruPro

What should loginAs() return in a page object?

QuizMediumAsked in: Infosys

After a successful login the app shows the dashboard. What is a good return value for the login page's loginAs / login_as method?

  • A new dashboard page object, so the test can chain the next step
  • The WebDriver itself
  • A boolean for "login worked"
  • Nothing, and tests create every page themselves

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in