Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create structured automatic testing with selenium (junit or testng)? What is your best practice for this?

I have written tests that are using selenium for functional testing. I'm using Java. I would like to be able to create structure between tests. Is it possible to do it with jUnit or TestNG?

Would like to be able to create test structure that will produce report like this:

Top test FAIL
- Module1 test PASS
-- Module1Class1 test PASS
-- Module1Class2 test PASS
--- Module1Class3Method1 test PASS
--- Module1Class3Method2 test PASS
- Module2 test FAIL
-- Module2Class1 test FAIL
--- Module2Class1Method1 test PASS
--- Module2Class1Method2 test FAIL
--- Module2Class1Method3 test PASS
like image 412
Urszula Karzelek Avatar asked Feb 28 '23 09:02

Urszula Karzelek


1 Answers

The best pattern I have seen for organizing the code behind selenium tests is the page object pattern:

http://blog.m.artins.net/acceptance-tests-with-jbehave-selenium-page-objects/

Here's a Java helper library:

http://code.google.com/p/webdriver/wiki/PageFactory

like image 100
ndp Avatar answered Apr 30 '23 04:04

ndp