I dont want to change the code, I am trying to write a Cucumber style Tellurium test. The source code is as follows.
package test
import module.GoogleSearchModule
import org.tellurium.test.groovy.TelluriumGroovyTestCase
this.metaClass.mixin(cuke4duke.GroovyDsl)
GoogleSearchModule gsm;
Given (~/The search is Hello World/){
gsm = new GoogleSearchModule();
gsm.defineUi();
TelluriumGroovyTestCase.newInstance().with {
}
}
When (~/The Search is performed/){
gsm.doGoogleSearch "Hello World"
}
Then (~/The browser title should have Hello World/){
assertEquals gsm.getBrowserTitle(),"Hello World"
}
and when it runs I get the following error.
Given The search is Hello World # test.GoogleSearchFeature$_run_closure1@15e565bd
[INFO] org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NullPointerException: Cannot invoke method connectUrl() on null object (NativeException)
[INFO] org/codehaus/groovy/reflection/CachedMethod.java:92:in `invoke'
[INFO] groovy/lang/MetaMethod.java:234:in `doMethodInvoke'
[INFO] org/codehaus/groovy/runtime/metaclass/ClosureMetaClass.java:272:in `invokeMethod'
[INFO] groovy/lang/MetaClassImpl.java:892:in `invokeMethod'
[INFO] groovy/lang/Closure.java:279:in `call'
[INFO] cuke4duke/internal/groovy/GroovyLanguage.java:33:in `invokeClosure'
I have used cucumber with Selenium before and it works really well using cuke4duke plugin. I am trying to write a tellurium test using Cucumber and it seems promising if I can instantiate any of the test base classes. I am afraid my lack of Groovy skills are not helping me.
Any help appreciated.
Thanks
Haroon