This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webdriver extends helperclass to assert

Albert Park
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, if this is a wrong section in the forum I apologize.
I am learning java and in the mean time learning about selenium webdriver, so bear with me.
I am playing with selenium webdriver to see if I can use it to test simple web browser.
However, I ran into a problem when I try to build a sample class that extends to super class to help me simplify things.
For example, verifying element present.

here is part of my subclass that actually runs the test.

So verifyLink method doesn't work correctly and always shows test passed.
So I know this way is making me use the driver in superclass and my subclass won't even throw an error when the test runs.
I want to make it so my subclass inherits the methods that I need, and use my own Webdriver object that is from subclass to make the test fail, when it should.
Can someone guide me to the correct design of creating a helper class.

Thanks in advance.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic