Hi,
I'm using Groovy testing. Test process went fine, but it couldn't
generate the results.html page. It has generated results.xml. I got the
following message when I run groovy script.
C:\Testing>groovy sampleTest.groovy
[INFO] HttpMethodDirector - -Redirect requested but followRedirects is
disabled
I'm just using the demo script,
def webtest_home = 'c:/canoowebtest' // System.properties.'webtest.home'
def ant = new AntBuilder()
ant.taskdef(resource:'webtest.taskdef'){
classpath(){
pathelement(location:"$webtest_home/lib")
fileset(dir:"$webtest_home/lib", includes:"**/*.jar")
}
}
ant.webtest(name:'Test Google with Groovy, AntBuilder and WebTest'){
steps(){
import com.gargoylesoftware.htmlunit.WebClient
invoke(url:'http://www.google.com')
verifyTitle(text:'Google')
setInputField(name:'q', value:'Groovy')
clickButton(name:'btnG')
verifyXPath(xpath:"//[EMAIL PROTECTED]'http://groovy.codehaus.org/']")
}
}
I found in one of the threads that it can be redirected from htmlunit
level. How do we do that? Is that the actual reason that the results
page is not getting generated? I tried importing htmlunit but it says;
C:\Testing>groovy sampleTest.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed, sampleTest.groovy: 1: unable to resolve class
com.gargoylesoftware.htmlunit.WebClient
@ line 1, column 1.
import com.gargoylesoftware.htmlunit.WebClient
^
I need your help please.
Thanks
-Jai