You better use "A.AA" to reference the UrlLink for AA. The "A." can be
omitted only if you have one Ui module
defined. As for why "AA" cannot be found, I need to create a test case and
see what happened. I will get back to you later.

Thanks,

Jian

On Sun, Oct 17, 2010 at 8:03 AM, Ryan <[email protected]> wrote:

> I get the html from the example
>
> <ul class="a">
>        <li>
>            <A HREF="site?tcid=a"
>               class="b">AA
>            </A>
>        </li>
>        <li>
>            <A HREF="site?tcid=b"
>               class="b">BB
>            </A>
>        </li>
>        <li>
>            <A HREF="site?;tcid=c"
>               class="b">CC
>            </A>
>        </li>
>        <li>
>            <A HREF="site?tcid=d"
>               class="b">DD
>            </A>
>        </li>
>        <li>
>            <A HREF="site?tcid=e"
>               class="b">EE
>            </A>
>        </li>
>        <li>
>            <A HREF="site?tcid=f"
>               class="b">FF
>            </A>
>        </li>
>    </ul>
>
> then, I use trump to generate the Ui
>
> package com.example.template.module
>
> import org.telluriumsource.dsl.DslContext;
>
> class NoTemplateList extends DslContext{
>
>        public void defineUi() {
>                ui.Container(uid: "A", clocator: [tag: "ul", class: "a"]){
>                        UrlLink(uid: "AA", clocator: [tag: "a", text: "AA",
> class: "b"])
>                        UrlLink(uid: "BB", clocator: [tag: "a", text: "BB",
> class: "b"])
>                        UrlLink(uid: "CC", clocator: [tag: "a", text: "CC",
> class: "b"])
>                        UrlLink(uid: "DD", clocator: [tag: "a", text: "DD",
> class: "b"])
>                        UrlLink(uid: "EE", clocator: [tag: "a", text: "EE",
> class: "b"])
>                        UrlLink(uid: "FF", clocator: [tag: "a", text: "FF",
> class: "b"])
>                }
>
>
>        }
>
>        public void click(uid) {
>
>                click("A." + uid)
>
>                waitForPageToLoad(10000)
>        }
> }
>
> then I write the test class:
>
> package com.example.template.test;
>
> import org.telluriumsource.test.java.TelluriumTestNGTestCase;
> import org.testng.annotations.BeforeClass;
> import org.testng.annotations.BeforeMethod;
> import org.testng.annotations.Test;
>
> import com.example.template.module.NoTemplateList;
>
> public class NoTemplateListTest extends TelluriumTestNGTestCase{
>
>        private static NoTemplateList listUi;
>
>        @BeforeClass
>        public static void initUi() {
>
>                listUi = new NoTemplateList();
>
>                listUi.defineUi();
>
>                connectSeleniumServer();
>
>                useCssSelector(true);
>
>                useTelluriumEngine(true);
>
>                useTrace(true);
>        }
>
>        @BeforeMethod
>        public void connectUrl() {
>
>
>  connectUrl("file:///C:/Users/Administrator/Desktop/template.html");
>
>        }
>
>        @Test
>        public void testAA() {
> //              useCssSelector(false);
> //
> //              listUi.dump("A.AA");
> //
> //              String html = listUi.toHTML();
> //
> //              System.out.println(html);
>
>                listUi.click("AA");
>        }
>
>        @Test
>        public void testDD() {
> //              useCssSelector(false);
> //
> //              listUi.dump("A.DD");
> //
> //              String html = listUi.toHTML();
> //
> //              System.out.println(html);
>
>                listUi.click("DD");
>        }
> }
>
> when I run it , I got:
> PASSED: testDD
> FAILED: testAA
> org.telluriumsource.exception.UiObjectNotFoundException: Cannot find
> UI Object AA
>        at org.codehaus.groovy.runtime.callsite.ConstructorSite
> $ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:
> 107)
>        at
>
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:
> 52)
>        at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
> 192)
>        at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
> 200)
>        at
>
> org.telluriumsource.dsl.BaseDslContext.walkToWithException(BaseDslContext.groovy:
> 155)
>        at org.telluriumsource.dsl.BaseDslContext
> $walkToWithException.callCurrent(Unknown Source)
>        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:
> 155)
>        at
> org.telluriumsource.dsl.BaseDslContext.click(BaseDslContext.groovy:
> 166)
>        at
>
> com.example.template.test.NoTemplateListTest.testAA(NoTemplateListTest.java:
> 47)
> ... Removed 27 stack frames
>
> ===============================================
>    com.example.template.test.NoTemplateListTest
>    Tests run: 2, Failures: 1, Skips: 0
> ===============================================
>
>
> I don't know why " Cannot find UI Object AA" and it can find A.DD, and
> is there a method I can validate the Ui before I run the test?
>
> Thank you.
>
> --
> 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.

Reply via email to