webdriver - How to get started with Selenium 2? -
i've read here , there should use selenium 2 (webdriver if understanding right). i'm not talking selenium ide easy use.
i've read documentation on selenium website (which claims not complete since selenium 2 isn't stable, fine). problem is: can't starting selenium.
i mean, described, i've downloaded it, launched it. i've found samples test case here , there.
but how (with selenium/webdriver):
- start test/test suite?
- structure test suites?
- where "put" tests?
- java or php test writing? (i've read php implementation wasn't enough stable now)
maybe have missed documentation on how works?, if can point me out.
as side note, i'm os x user, though think not issue.
thanks.
a proven solution, i've implemented core concepts @ couple of companies can found at...
conductor framework. i've built project exclusively purpose of open source, , people started selenium 2. project has apache 2 license, able take it, , use in enterprise solutions @ discretion.
this project includes using technologies of..
- java
- eclipse
- junit
- maven
- selenium 2
- git
and each piece of software has role play.
java
tests written in java, , embracing cross-platform abilities.
eclipse
a proven , used ide solution java developers around world.
junit
a unit testing software runs java unit tests
maven
arguably best dependency management , build management software can have java.
selenium 2
the second installment of selenium browser automation software, surpasses selenium 1 because ties directly browser api, instead of injecting javascript.
git
an amazingly easy-to-use (once you're used it) source control management solution.
that's it.
so questions. i'm going put them in context of getting started selenium framework i've provided above.
start test/test suite?
using junit combined java, write test, right click method want run, , click run -> junit test , off goes.
structure test suites
if use junit, structure need, classes , methods. example...
/** * tests site */ @config(url="http://example.com", browser=chrome) public class testmysite extends locomotive { @test public void testsomething() { click(by.linktext("something")) .validatetext(by.cssselector("input"), "something"); } @test public void testsomethingelse() { check(by.cssselector("input[type='checkbox']")) .validatechecked(by.cssselector("input[type='checkbox']")); } } you able run tests individually running methods. additionally, suites managed class, can run class run methods, , nice report afterwards. 
where put tests?
per maven convention, recommend having nice , tidy workspace, , test/source architecture. in getting started project, projects placed in src/tests/java package, , anywhere within there. schedule continuous integration server launch particular package. example, google. if wanted test results, target results package, , junit classes found within package, ran.
java or php test writing.
this based on preference, , it's going subjective. 1 thing keep in mind though... selenium 2 coded in java , other software port other contributors. ergo, java going up-to-date , stable.
Comments
Post a Comment