Actually that was the first thing I tried, however the result was :
- [error] Error generating UI module and commands: message:
this.tagObjectArray[i] is null, name: TypeError, filename:
chrome://source/content/uicreator/uimodule-alg.js, linenumber: 234.
JavaScript Error Stack:
{anonymous}()@chrome://source/content/uicreator/uimodule-alg.js:442
{anonymous}(null)@chrome://source/content/workspace.js:764
{anonymous}()@chrome://source/content/workspace.js:520
{anonymous}()@chrome://source/content/recorder.js:556 {anonymous}([object
BeforeUnloadEvent])@chrome://source/content/recorder.js:111
That's why I'm trying to figure out how to do this "by hand".
On Tue, Jan 18, 2011 at 2:08 PM, Rohit Vats <[email protected]> wrote:
> You can download the Trump IDE plugin for firefox. That will automatically
> generate the UI modules for your elements as you click on them.
>
>
> On 18 Jan 2011, at 12:49, Szewczyk Dratewka <[email protected]> wrote:
>
> Thanks, setting the values to false gets the test working. I didn't know
> that using
> tellurium engine and css selectors had implications on using xpath. This
> makes me think
> that maybe I don't have to use xpath at all. Till now I've been trying to
> use it to solve a case
> in which there is a bunch of links like so:
>
> <div class='menu'>
> <a href=" <http://www.foo.com/>http://www.foo.com
> "><span>Foo</span></a>
> <a href=" <http://www.foo.com/>http://www.bar.com
> "><span>Bar</span></a>
> </div>
>
> and I want to get the foo link. Now if there was no <span> inside, I could
> just use
> ui.UrlLink(uid: "TheLink", clocator : [tag :"a", text : "Foo"])
>
> but the <span> makes it more difficult. Obviously I can use xpath to do
> this, but
> is there a better alternative?
>
> Thanks,
> dratewka
>
> p.s. I know that java would be better, but this is just a sandbox project.
>
> On Tue, Jan 18, 2011 at 1:23 PM, Jian Fang < <[email protected]>
> [email protected]> wrote:
>
>> The real problem is caused by the following two lines:
>> useTelluriumEngine(true);
>> useCssSelector(true)
>>
>> First, Tellurium engine does not use xpath. Second, you cannot use CSS
>> selector because
>> you use xpath. Please simply replace the above two lines with the
>> following line
>>
>> useCssSelector(false)
>>
>> BTW, seems you use a groovy class to extend the JUnit Java class. You
>> better use a Java class.
>>
>> Thanks,
>>
>> Jian
>>
>> On Tue, Jan 18, 2011 at 5:51 AM, dratewka < <[email protected]>
>> [email protected]> wrote:
>>
>>> Hello everybody,
>>>
>>> recently I've been trying to get tellurium to work with the project
>>> I'm working on, however
>>> it has been a bumpy road so far.
>>> I've set up the environment using
>>>
>>> mvn archetype:create -DgroupId=your_group_id -
>>> DartifactId=your_artifact_id \
>>> -DarchetypeArtifactId=tellurium-junit-archetype \
>>> -DarchetypeGroupId=org.telluriumsource -DarchetypeVersion=0.7.0 \
>>> -DarchetypeRepository=<http://maven.kungfuters.org/content/repositories/>
>>> http://maven.kungfuters.org/content/repositories/
>>> releases
>>>
>>>
>>> and made a simple web page to play around with xpath locators.
>>> The problem is, that they don't seem to work. At all.
>>>
>>> Here is a simple example - the web page :
>>>
>>> <html>
>>> <head></head>
>>> <body>
>>> <a href=" <http://www.foo.com>http://www.foo.com">Foo</a>
>>> </body>
>>> </html>
>>>
>>>
>>> Ui module :
>>>
>>> public class FooModule extends DslContext{
>>>
>>> public void defineUi() {
>>> ui.UrlLink(uid: "TheLink", locator : "//a");
>>> }
>>> }
>>>
>>> Test :
>>> public class FooTestCase extends TelluriumJUnitTestCase{
>>>
>>> private static FooModule foo;
>>>
>>> @BeforeClass
>>> public static void initUi() {
>>> foo = new FooModule();
>>> foo.defineUi();
>>> connectSeleniumServer();
>>> useTelluriumEngine(true);
>>> useCssSelector(true)
>>>
>>> useTrace(true);
>>> }
>>>
>>> @Before
>>> public void connectToLocal() {
>>> connectUrl("file:///C:/Temp/html/index.html")
>>> }
>>>
>>> @Test
>>> public void execFlow1(){
>>> foo.click "TheLink"
>>> pause 10000
>>> }
>>>
>>> }
>>>
>>> Now, if I change the ui module to :
>>> ui.UrlLink(uid: "TheLink", clocator : [tag :"a"])
>>> then everything works fine. However running it with the locator
>>> described above I get:
>>>
>>> com.thoughtworks.selenium.SeleniumException: ERROR: Command execution
>>> failure. Please search the Tellurium User Group at
>>> <http://groups.google.com/group/tellurium-users>
>>> http://groups.google.com/group/tellurium-users for error details from
>>> the log window. The error message is: Syntax error, unrecognized
>>> expression:
>>> at
>>>
>>> com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
>>> 97)
>>> at
>>>
>>> com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
>>> 91)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39)
>>> at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>>> 25)
>>> at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite
>>> $PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:
>>> 229)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:
>>> 52)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>>> 129)
>>> at
>>>
>>> org.telluriumsource.component.connector.CustomSelenium.getBundleResponse(CustomSelenium.groovy:
>>> 257)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39)
>>> at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>>> 25)
>>> at
>>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
>>> 88)
>>> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>>> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
>>> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
>>> at
>>> groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:
>>> 149)
>>> at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown
>>> Source)
>>> at
>>>
>>> org.telluriumsource.component.dispatch.Dispatcher.methodMissing(Dispatcher.groovy:
>>> 56)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39)
>>> at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>>> 25)
>>> at
>>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
>>> 88)
>>> at
>>> groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:
>>> 813)
>>> at
>>> groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:
>>> 1107)
>>> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)
>>> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:
>>> 39)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
>>> 40)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>>> 117)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>>> 129)
>>> at
>>>
>>> org.telluriumsource.component.bundle.BundleProcessor.flush(BundleProcessor.groovy:
>>> 372)
>>> at org.telluriumsource.component.bundle.BundleProcessor
>>> $flush.call(Unknown Source)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
>>> 40)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>>> 117)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>>> 121)
>>> at
>>>
>>> org.telluriumsource.framework.TelluriumFramework.pause(TelluriumFramework.groovy:
>>> 371)
>>> at
>>>
>>> org.telluriumsource.test.java.BaseTelluriumJavaTestCase.pause(BaseTelluriumJavaTestCase.java:
>>> 156)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39)
>>> at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>>> 25)
>>> at
>>> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
>>> 88)
>>> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>>> at
>>> groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:
>>> 1326)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.callStatic(StaticMetaClassSite.java:
>>> 47)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:
>>> 48)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
>>> 167)
>>> at
>>>
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:
>>> 175)
>>> at test.FooTestCase.execFlow1(FooTestCase.groovy:32)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>>> 39)
>>> at
>>>
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>>> 25)
>>> at org.junit.runners.model.FrameworkMethod
>>> $1.runReflectiveCall(FrameworkMethod.java:44)
>>> at
>>>
>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
>>> 15)
>>> at
>>>
>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
>>> 41)
>>> at
>>>
>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:
>>> 20)
>>> at
>>>
>>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
>>> 28)
>>> at
>>>
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
>>> 76)
>>> at
>>>
>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
>>> 50)
>>> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>>> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>>> at
>>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>>> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>>> at
>>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>>> at
>>>
>>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
>>> 28)
>>> at
>>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
>>> 31)
>>> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>>> at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
>>> at
>>> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:
>>> 65)
>>>
>>>
>>>
>>>
>>> According to tellurium manual such a locator using xpath should be
>>> valid,
>>> so I don't know what's going on.
>>>
>>> I'm running the test using Firefox 3.6.10 on a Windows 7 box.
>>>
>>>
>>> Regards,
>>> dratewka
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "tellurium-users" group.
>>> To post to this group, send email to <[email protected]>
>>> [email protected].
>>> To unsubscribe from this group, send email to
>>> <tellurium-users%[email protected]>
>>> [email protected].
>>> For more options, visit this group at
>>> <http://groups.google.com/group/tellurium-users?hl=en>
>>> http://groups.google.com/group/tellurium-users?hl=en.
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "tellurium-users" group.
>> To post to this group, send email to <[email protected]>
>> [email protected].
>> To unsubscribe from this group, send email to
>> <tellurium-users%[email protected]>
>> [email protected].
>> For more options, visit this group at
>> <http://groups.google.com/group/tellurium-users?hl=en>
>> http://groups.google.com/group/tellurium-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "tellurium-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/tellurium-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "tellurium-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<tellurium-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/tellurium-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tellurium-users?hl=en.