Yes Jian you are correct. The window is identified only by the name and not
by anything else

Regards
Hari

On Fri, Oct 9, 2009 at 8:35 PM, Jian Fang <[email protected]> wrote:

> If I remember correctly, seems Selenium uses only name (or ID?) to
> locate a window. title May not be actually used.
>
> Dominic, seems you used Window objects a lot. Do you have any input?
>
> Thanks,
>
> Jian
>
> On Fri, Oct 9, 2009 at 9:27 AM, Rune <[email protected]> wrote:
>
>>
>> Thanks.
>>
>> I can get it to work with:
>> ui.Window(uid: "popupwindow", name: "PopupName" ){
>>
>> but I get the same issue with:
>> ui.Window(uid: "popupwindow", title: "PopupTitle" ){
>>
>> Solved my problem for now, but any idea of why this is?
>>
>> Thansk.
>>
>> Rune.
>>
>> On Oct 9, 3:07 pm, Jian Fang <[email protected]> wrote:
>> > Hi Rune,
>> >
>> > Window object has extra attributes such as id, name, and title, which
>> are
>> > not
>> > defined in clocator, but should belong to the Window object itself. More
>> > details here,
>> >
>> > http://code.google.com/p/aost/wiki/UserGuideUIObjects#Window
>> >
>> > Under the hood, the name attribute is used by Selenium for popup window,
>> > thus,
>> > you need to specify the name attribute for your popup window.
>> >
>> > Please let us know if this could solve your problem.
>> >
>> > Thanks,
>> >
>> > Jian
>> >
>> > On Fri, Oct 9, 2009 at 7:54 AM, Rune <[email protected]> wrote:
>> >
>> > > Hi all.
>> >
>> > > Can't get my head around this. I have to write a test for an 3rd party
>> > > application that uses popups.
>> >
>> > > This example illustrates the problem:
>> >
>> > > UI elements:
>> >
>> > > //Link that creates a popup window on the main window.
>> > > ui.Container(uid: "mainwindow", clocator: [tag: "body"]){
>> > >  UrlLink(uid: "makepopup", clocator: [tag: "a", text: "Click to make
>> > > popup"])
>> > > }
>> >
>> > > //The popup window
>> > > ui.Window(uid: "popupwindow", clocator: [title: "PopupTitle"] ){
>> > > }
>> >
>> > > //A Link on the popup page
>> > > ui.Container(uid: "popup", clocator: [tag: "body"]){
>> > >  UrlLink(uid: "link", clocator: [tag: "a", text: "vg"])
>> > > }
>> >
>> > > The test:
>> >
>> > > public void generatePopup() {
>> > >                waitForPageToLoad 10000;
>> > >                click "mainwindow.makepopup"
>> > >                waitForPopUp "popupwindow", 10000
>> > >                selectWindow "popupwindow"
>> > >                click "popup.link"
>> > >        }
>> >
>> > > This generates:
>> >
>> > > java.lang.NullPointerException
>> > >        at java.net.URLEncoder.encode(Unknown Source)
>> > >        at com.thoughtworks.selenium.DefaultRemoteCommand.urlEncode
>> > > (DefaultRemoteCommand.java:86)
>> > >        at
>> > > com.thoughtworks.selenium.DefaultRemoteCommand.getCommandURLString
>> > > (DefaultRemoteCommand.java:59)
>> > >        at com.thoughtworks.selenium.HttpCommandProcessor.doCommand
>> > > (HttpCommandProcessor.java:86)
>> > >        at com.thoughtworks.selenium.DefaultSelenium.waitForPopUp
>> > > (DefaultSelenium.java:367)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > >        at java.lang.reflect.Method.invoke(Unknown Source)
>> > >        at org.codehaus.groovy.reflection.CachedMethod.invoke
>> > > (CachedMethod.java:86)
>> > >        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
>> > >        at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1049)
>> > >        at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:880)
>> > >        at groovy.lang.DelegatingMetaClass.invokeMethod
>> > > (DelegatingMetaClass.java:149)
>> > >        at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown
>> Source)
>> > >        at
>> org.tellurium.dispatch.Dispatcher.invokeMethod(Dispatcher.groovy:
>> > > 26)
>> > >        at
>> org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call
>> > > (PogoInterceptableSite.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)
>> > >        at
>> org.tellurium.access.Accessor.waitForPopUp(Accessor.groovy:194)
>> > >        at org.tellurium.access.Accessor$waitForPopUp.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:129)
>> > >        at org.tellurium.dsl.DslContext$_waitForPopUp_closure9.doCall
>> > > (DslContext.groovy:167)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > >        at java.lang.reflect.Method.invoke(Unknown Source)
>> > >        at org.codehaus.groovy.reflection.CachedMethod.invoke
>> > > (CachedMethod.java:86)
>> > >        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
>> > >        at
>> > > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod
>> > > (ClosureMetaClass.java:272)
>> > >        at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:880)
>> > >        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:125)
>> > >        at org.tellurium.object.Window.waitForPopUp(Window.groovy:40)
>> > >        at org.tellurium.object.Window$waitForPopUp.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:129)
>> > >        at
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe
>> > > (AbstractCallSite.java:97)
>> > >        at
>> org.tellurium.dsl.DslContext.waitForPopUp(DslContext.groovy:166)
>> > >        at
>> org.tellurium.dsl.DslContext$waitForPopUp.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
>> com.<myproject>.tellurium.MyModule.generatePopup(MyModule.groovy:
>> > > 27)
>> > >        at
>> > > com.<myproject>.tellurium.MyTestCase.testPopup(MyTestCase.java:34)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > >        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > >        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > >        at java.lang.reflect.Method.invoke(Unknown Source)
>> > >        at
>> org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
>> > >        at org.junit.internal.runners.MethodRoadie.runTestMethod
>> > > (MethodRoadie.java:98)
>> > >        at
>> org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:
>> > > 79)
>> > >        at
>> > > org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters
>> > > (MethodRoadie.java:87)
>> > >        at
>> > > org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:
>> > > 77)
>> > >        at
>> org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
>> > >        at
>> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod
>> > > (JUnit4ClassRunner.java:88)
>> > >        at org.junit.internal.runners.JUnit4ClassRunner.runMethods
>> > > (JUnit4ClassRunner.java:51)
>> > >        at org.junit.internal.runners.JUnit4ClassRunner$1.run
>> > > (JUnit4ClassRunner.java:44)
>> > >        at org.junit.internal.runners.ClassRoadie.runUnprotected
>> > > (ClassRoadie.java:27)
>> > >        at org.junit.internal.runners.ClassRoadie.runProtected
>> > > (ClassRoadie.java:37)
>> > >        at org.junit.internal.runners.JUnit4ClassRunner.run
>> > > (JUnit4ClassRunner.java:42)
>> > >        at
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
>> > > (JUnit4TestReference.java:46)
>> > >        at org.eclipse.jdt.internal.junit.runner.TestExecution.run
>> > > (TestExecution.java:38)
>> > >        at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
>> > > (RemoteTestRunner.java:467)
>> > >        at
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
>> > > (RemoteTestRunner.java:683)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
>> > > (RemoteTestRunner.java:390)
>> > >        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
>> > > (RemoteTestRunner.java:197)
>> >
>> > > I'm pretty new to Tellurium, so if anyone have any clue I would be
>> > > greatfull
>> >
>> > > Thanks, Rune.
>> >
>> >
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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