openUrl() is missing from0.6 ?!

6 views
Skip to first unread message

Zsolt Kovacs

unread,
Sep 21, 2009, 7:56:25 AM9/21/09
to telluri...@googlegroups.com
Hi,

I am unable to find the openUrl DSL method in the 0.6 release. I have tried the jar and also checked out tags/tellurium-0.6.0/core, but neither the DslContext nor BaseDslContext has got such method. I can click or type but calling openUrl throws this exception:

groovy.lang.MissingMethodException: No signature of method: com.medicanimal.test.tellurium.ui.MANewUserPage.openUrl() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [https://localhost:8443/pageURL]
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:151)
    at com.medicanimal.test.tellurium.ui.MANewUserPage.open(MANewUserPage.groovy:59)

Is it truly missing or I am doing something wrong?

Thanks,

Zsolt

Jian Fang

unread,
Sep 21, 2009, 9:11:13 AM9/21/09
to telluri...@googlegroups.com
OpenUrl is on the base Java/Groovy test case class. Not on DslContext. Please use

openUrl(URL)

directly.

Thanks,

Jian

Zsolt Kovacs

unread,
Sep 21, 2009, 10:50:09 AM9/21/09
to telluri...@googlegroups.com
I am sorry but I do not really understand your answer. Your answer suggest, that I can only call it from a class which inherits from TelluriumJavaTestCase. Unfortunately I cannot do that, I need like to call openUrl() in a class, which inherits from DslContext.

In fact the User Guide has examples like openUrl "http://code.google.com/p/aost/on page A18, that is why I was so keen to use it.

Thanks,

Zsolt

2009/9/21 Jian Fang <john.ji...@gmail.com>

Jian Fang

unread,
Sep 21, 2009, 11:45:42 AM9/21/09
to telluri...@googlegroups.com
Well, that is a Dsl script. The magic is that we use the DslScriptEngine class for the super class of all Dsl scripts, which extends DdDslContext (a subclass of DslContext) and also has a delegate to DslTelluriumGroovyTestCase.

http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/dsl/DslScriptEngine.groovy

The DslTelluriumGroovyTestCase includes the openUrl() method. The reason we did in this way is due to Java's single inheritance nature. Groovy Mixin feature is not mature yet, otherwise we can mixin the DslTelluriumGroovyTestCase to DslScriptEngine.

Thanks,

Jian

Zsolt Kovacs

unread,
Sep 21, 2009, 2:09:07 PM9/21/09
to telluri...@googlegroups.com
I see. Is there any reason that the selenium open() is not supported by DslContext or BaseDslContext?

I would love to have that method because I am in the same situation like you are, inheritance in my classes is already used. I am implementing a business specific DSL to write functional tests that span across different applications. Which means that the implementation of the script has to be able to open those applications. At the moment it is implemented using Selenium, but we are already struggling with maintenance, that is why I started to evaluate Tellurium.

If there is no technical reason I can try to implement an open(url) method in DslContext. Alternatively I can try to use SeleniumConnector in my code, but for that I suggest to convert it to an AST based singleton, if that is possible.

Jian Fang

unread,
Sep 21, 2009, 3:50:23 PM9/21/09
to telluri...@googlegroups.com
DslContext is really related to just one UI module class and the test class may have multiple
UI module classes and thus, we like to separate the openUrl() method from DslContext so that openUrl() decouples from UI modules. Also, all the connection setup including framework initialization are handled in Base Java/Groovy Test class, which makes it difficult to include openUrl() in DslContext. The more important reason is the separation seems to be a more clear design.

For your case, why you cannot use our Dsl Engine which supports openUrl() directly?

If you really like to use your own Dsl, you can either use a delegate just like what we did in the Dsl Engine class, or you can try Groovy 1.6 Mixin feature, which I haven't done full research on.

I am aware of the new @Singleton annotation for Groovy 1.6, but haven't converted all the code to use it yet. Thanks for reminding me of this.

Thanks,

Jian

Jian Fang

unread,
Sep 21, 2009, 4:03:13 PM9/21/09
to telluri...@googlegroups.com
Alternatively, you could add the content of BaseTelluriumGroovyTestCase and DslTelluriumGroovyTestCase classes into your own Dsl class if your DSL is Groovy
based.

http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/groovy/BaseTelluriumGroovyTestCase.groovy

http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/groovy/DslTelluriumGroovyTestCase.groovy

Or if you use your own parser and implement your DSL in Java, you can refer to the
BaseTelluriumJavaTestCase class on how to add openUrl into your own Dsl class.

http://code.google.com/p/aost/source/browse/trunk/core/src/main/groovy/org/tellurium/test/java/BaseTelluriumJavaTestCase.java

Hope this can help.

Thanks,

Jian

Zsolt Kovacs

unread,
Sep 22, 2009, 4:05:26 AM9/22/09
to telluri...@googlegroups.com
Thank you indeed for your suggestions.

I understand your design does not foresee the open(url) method in DslContext. For our current design it is a bit restrictive though, because we rely on the fact that each class knows its relative url, and it can open the root page it represents in the testing environment.

We also ruled out to extend your DSL, because we build a DSL which is has much higher level method like createBasket() or cancelOrder(), and we want to use Tellurium to implement these methods. In fact it similar to your data driven framework, in a sense that it may open many pages. And those tests does use openUrl (eg. TelluriumIssuesModule), but I am reluctant to start using the DD module, becuase its supporting classes are far too complex for my needs.

So I think I will stick use SeleniumConnector in my framework, probably I will patch the 0.6 source to make it singleton (i can send the patch if you wish), and I still hope that I was able to convince you to add the open method to DslContext sometimes in the near future ;).

Jian Fang

unread,
Sep 22, 2009, 9:10:28 AM9/22/09
to telluri...@googlegroups.com
I understand your situation. Yes, please send us the patch.

Sure, we will consider your request and see if we can add openUrl to DslContext later.

Thanks,

Jian
Reply all
Reply to author
Forward
0 new messages