Inheritance in Selenium not showing correct test count

I tried to test my inheritance skill with Selenium. After creating package called MailAccess I have 3 classes under MailAccess package-

  1. VisitPage class (main)
  2. VerifyTitle class (extends VisitPage)
  3. VerifyUsername class (extends VerifyTitle)

    public class VisitPage { public static FirefoxDriver f= new FirefoxDriver();

Problem: When I run it (right click on Package name>Run as> TestNG Test), this is what I see

Question: Why 4 tests when I have only 3 and 3 have same name as testURL?

nishu81 Default Asked on May 14, 2016 in Selenium WebDriver.
Add Comment
2 Answer(s)


That looks like a very interesting problem. Let me try this at home and I will get back to you.


Virender Singh Professor Answered on May 16, 2016.
Add Comment


You are running this at package level. There all classes will be treated as separate.

VerifyTitle  -> 1 Test
VerifyUsername  -> 2 tests (testUserName and testTitleOf)
fourth one is testURL. Class name is not visible in the code that you have pasted. So it is quite expected.


Virender Singh Professor Answered on May 18, 2016.
Add Comment

Your Answer

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