xml - Better way to run selenium webdriver tests? -
we run large amount of tests java webdriver every day. use testng, , use bat files execute testng xmls, using classed compiled eclipse. i'm wondering, though, if there's better way this. since run hundreds (thousands?) of test cases daily, have resort creating testng xmls execute entire packages, otherwise we'd have manually create xml each test, , that's not practical.
one problem executing such large tests containing hundreds of classes if there's 1 major issue (such webdriver stalling or hanging), entire test not run. also, have listener uploads server @ end of test, have wait hours results uploaded @ once (something more in "real time" better). problem if vms reboot whatever reason, "progress" lost , we'd have run tests beginning.
i've seen ant builds mentioned around testng website, i'm not sure advantages of ant on using bat files execute xmls. can shed light on this? or offer solutions executing large number of tests more elegant bat files?
thanks!
instead of using eclipse build (or ant) i'd recommend use gradle (http://gradle.org/). has great support testng , can run test using command gradlew clean test
(instead of bat files)
instead of creating xml manually etc. can use test groups in @test
annotation can pick tests based on groups not on packages. can pass group names via gradle - gradlew clean build -ptestgroup=smoke,unit
(then pass testng in build.gradle
file http://gradle.org/docs/current/groovydoc/org/gradle/api/tasks/testing/testng/testngoptions.html)
for more "real time" result can upload results after each test/configuration method using org.testng.testlisteneradapter
(depends on result processing structure)
if want way more faster execution of selenium tests there 1 option (if optimized dom processing etc.) , it's parallelism - 2 or more vms , split tests based on groups/packages etc. or more sophisticated/programmatic method.
Comments
Post a Comment