Proper way to do sub test?

20 views
Skip to first unread message

Kelly Dunn

unread,
Jan 12, 2022, 1:58:40 AM1/12/22
to Selenium Users
Using Selenium-java WebDriver 3.141.59 with Mavern and TestNG 6.8.8 and POM
I have a Test Object for my page. The page has many functionalities that are interconnected. 
For instance:
Add type 1 a record in a form
Edit record in the same form 
Verify record data in a table
Verify record data in a  detail view
Delete record
Repeat the above for record type 2 and Type 3

Right now each of these tasks are methods in the Page class
The test class instantiates the page and calls each method  under a single test annotation for each record type
@Test Type 1 Pass/Fail
instantiate page
call add method
call edit method 
call verify table
call verify detail
call delete

The test is triggered by the Test.xml.
I find the reporting very difficult to read, and I want to be able to annotate each task as a separate test without losing the data values captured in a previous task. Is this possible, can anyone share an example of the right way to accomplish this?

Test Page
  ---> @Test Type 1 - Pass Fail  (parent)
          ---> @Test Add  Pass/Fail
          ---> @Test Edit Pass/Fail
          ---> @Test Verify Table Pass/Fail
          ---> @Test Verify Detail Pass/Fail
          ---> @Test Delete Pass/Fail


Reply all
Reply to author
Forward
0 new messages