Cannot invoke method getId() on null object

211 views
Skip to first unread message

Jonathan Share

unread,
Apr 6, 2010, 4:44:36 AM4/6/10
to telluri...@googlegroups.com
Hi,

I've just had the latest updates that happened over easter come in,
I've updated my pom's to add the new dependency and update selenium to
1.0.1-te3-SNAPSHOT however my tests are failing on the following, very
simple definition.

ui.Container(uid: "header", locator: "//table[@class =
'outerBox']/tbody/tr[1]") {
Container(uid: "nav", clocator: [tag: "table"]) {
UrlLink(uid: "logout", clocator: [href: "*logout.do"])
}
}

As I've used xpath here I tried adding a call to disableCssSelector()
however this has no effect. Stacktrace is below.

Do I really have to go through and change out all of my XPaths? Or is
there another configuration directive I should try?

Regards,

Jonathan


java.lang.NullPointerException: Cannot invoke method getId() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:17)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
at org.telluriumsource.ui.builder.UiObjectBuilder.internBuild(UiObjectBuilder.groovy:86)
at org.telluriumsource.ui.builder.UiObjectBuilder$internBuild.callCurrent(Unknown
Source)
at org.telluriumsource.ui.builder.ContainerBuilder.build(ContainerBuilder.groovy:16)
at org.telluriumsource.ui.builder.ContainerBuilder$build.call(Unknown
Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.telluriumsource.ui.builder.UrlLinkBuilder$build.call(Unknown
Source)
at org.telluriumsource.dsl.UiDslParser.createNode(UiDslParser.groovy:152)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:96)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
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)

Jonathan Share

unread,
Apr 6, 2010, 5:25:39 AM4/6/10
to telluri...@googlegroups.com
After commenting out this definition and updating all tables and lists
to the new UID format my test is now able to start running (although I
have other problems) so this issue doesn't seem to be xpath related.

Jonathan Share

unread,
Apr 6, 2010, 6:40:50 AM4/6/10
to telluri...@googlegroups.com
After renaming the outer container to head instead of header, my code
now works again.

Jian Fang

unread,
Apr 6, 2010, 10:26:59 AM4/6/10
to telluri...@googlegroups.com
Yes, the UI template should be included in "{ }" now, otherwise, the parser
cannot differentiate the id from the template index.

Do you mean that you cannot use "header" as the uid? Strange. I will take a look.

Thanks,

Jian

--
You received this message because you are subscribed to the Google Groups "tellurium-users" group.
To post to this group, send email to telluri...@googlegroups.com.
To unsubscribe from this group, send email to tellurium-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.


Jonathan Share

unread,
Apr 6, 2010, 10:45:22 AM4/6/10
to telluri...@googlegroups.com
Yes, that's what I meant, this wasn't in a template

Jian Fang

unread,
Apr 6, 2010, 2:30:40 PM4/6/10
to telluri...@googlegroups.com
I can see why now. ANTLR 3 defined a implicit token  'header' when it saw the grammar such as

'{' 'header' ':' INDEX '}' 'as' ID
Since the "header" is reserved as a token, ANTLR 3 tried to match the grammar 'header' : index. Similarly,
the "->" is also an implicit token, when ANTLR 3 saw "-", it tried to match it with "->".

As a result, the implicit tokens such as "header", "footer", "row", "column", and "tbody"
are all reserved for UDL and they cannot be used as IDs.

But UDL is case-sensitive, you can still use "Header", "Footer", "Row", "Column", and "TBody" as IDs.

Thanks,

Jian
Reply all
Reply to author
Forward
0 new messages