Just one match. I can use JQuery selectors again! Thanks. I've got another
issue though (what a surprise). New command execution failure:
09:12:06.309 INFO - Command request:
getDiagnosisResponse[jquery=div.x-grid3-viewport:group(table,
div[class*=x-grid3-row]) div[class*=x-grid3-row],
{"uid":"ProjectsTable.body","pLocator":"jquery=div.x-grid3-viewport:group(table,
div[class*=x-grid3-row])","retMatch":true,"retParent":true,"retClosest":true,"attributes":{"tag":"div","class":"*x-grid3-row"},"retHtml":true}]
on session 2aed21f6e82242f298039b229fa43022
09:12:06.410 INFO - Got result: ERROR: Command execution failure. Please
search the forum at http://clearspace.openqa.org for error details from the
log window. The error message is: tag is not defined on session
2aed21f6e82242f298039b229fa43022
09:12:06.416 INFO - Command request:
captureScreenshot[./target/screenshots/Screenshot1251382326414.png, ] on
session 2aed21f6e82242f298039b229fa43022
09:12:06.419 INFO - Creating Robot
09:12:07.722 INFO - Got result: OK on session
2aed21f6e82242f298039b229fa43022
Screenshot for exception <<ERROR: Command execution failure. Please search
the forum at http://clearspace.openqa.org for error details from the log
window. The error message is: tag is not defined>> is saved to file
./target/screenshots/Screenshot1251382326414.png
Here's the ui definition:
ui.Container( uid: "ProjectsTable",
clocator: [tag: "div",
class: "x-grid3-viewport"],
group: "true"){
Table( uid: "header",
clocator: [tag: "table"],
group: "true"){
Div( uid: "header: 1",
clocator: [tag: "div",
text: "",
class: "x-grid3-hd-inner
x-grid3-hd-numberer"])
Div( uid: "header: 2",
clocator: [tag: "div",
text: "Project Name",
class: "x-grid3-hd-inner
x-grid3-hd-1"])
Div( uid: "header: 3",
clocator: [tag: "div",
text: "Project Label",
class: "x-grid3-hd-inner
x-grid3-hd-2"])
Div( uid: "header: 4",
clocator: [tag: "div",
text: "Project Owner",
class: "x-grid3-hd-inner
x-grid3-hd-3"])
Div( uid: "header: 5",
clocator: [tag: "div",
text: "Science Center",
class: "x-grid3-hd-inner
x-grid3-hd-4"])
Div( uid: "header: 6",
clocator: [tag: "div",
text: "Creation Date",
class: "x-grid3-hd-inner
x-grid3-hd-5"])
Div( uid: "header: 7",
clocator: [tag: "div",
text: "First Sample Date",
class: "x-grid3-hd-inner
x-grid3-hd-6"])
Div( uid: "header: 8",
clocator: [tag: "div",
text: "Last Sample Date",
class: "x-grid3-hd-inner
x-grid3-hd-7"])
Div( uid: "header: 9",
clocator: [tag: "div",
text: "Total Field Samples",
class: "x-grid3-hd-inner
x-grid3-hd-8"])
Div( uid: "header: 10",
clocator: [tag: "div",
text: "Write Access",
class: "x-grid3-hd-inner
x-grid3-hd-9"])
}
Container( uid: "body",
clocator: [tag: "div",
class:
"*x-grid3-row"], <--- Here's
the one
group: "true",
respond: ["click"]){
Table( uid: "row1",
clocator: [tag: "table",
class:
"x-grid3-row-table"],
group: "true"){
Div( uid: "row: 1, column: 2",
clocator: [tag: "div",
class:
"x-grid3-cell-inner x-grid3-col-1"])
Div( uid: "all", clocator: [:])
}
}
}
The failure occurs when using XPath as well (it makes sense in that case as
XPath doesn't support partial matching). When I remove the 'class:
"*x-grid3-row"', the problem goes away. Something appears to be wrong with
the partial matching. I know you mentioned that it doesn't work for the
'style' attribute, but I thought it would for the 'class' attribute.
Group locating looks great though.
Thanks again for your help,
Gabe
On Wed, Aug 26, 2009 at 10:15 PM, Jian Fang <[email protected]>wrote:
> Hi Gabe,
>
> I updated the group locating implementation for jQuery selector. Do you
> mind updating your Tellurium core and custom selenium server from our Maven
> repo, then try to use jQuery for your test case to see if you still get back
> 5 matches?
>
> Thanks in advance,
>
> Jian
>
>
> On Wed, Aug 26, 2009 at 3:39 PM, Jian Fang <[email protected]>wrote:
>
>> Gabe,
>>
>> You don't need to send me the html source. I tested on some html created
>> by my own and seems my group locating implementation is problematic. I am
>> working on a new implementation now.
>>
>> Thanks,
>>
>> Jian
>>
>>
>> On Wed, Aug 26, 2009 at 3:17 PM, Gabriel Johnson
>> <[email protected]>wrote:
>>
>>> Hi Jian,
>>>
>>> I'd like to send the html to you, but I have a bigger problem right now.
>>> I left work yesterday (after having switched to XPath) and everything was
>>> working fine. When I came back this morning, however, The browser doesn't
>>> even start up. Here's the console:
>>>
>>> -------------------------------------------------------
>>> T E S T S
>>> -------------------------------------------------------
>>> Running gov.usgswim.biodata.test.ProjectPageTestCase
>>> Parse configuration file: TelluriumConfig.groovy
>>> Configure UI Object Builders using configuration file
>>> Configure widget modules using configuration file
>>> Configure event handler using configuration file
>>> Configure data accessor using configuration file
>>> Configure dispatcher using configuration file
>>> Configure Embedded Selenium Server using configuration file
>>> Warning: No user-extensions.js found!
>>> 14:03:35.005 INFO - Java: Apple Inc. 11.3-b02-83
>>> 14:03:35.005 INFO - OS: Mac OS X 10.5.7 x86_64
>>> 14:03:35.012 INFO - v1.0.1 [2697], with Core v...@version@ [...@revision@]
>>> 14:03:35.077 INFO - Version Jetty/5.1.x
>>> 14:03:35.078 INFO - Started
>>> HttpContext[/selenium-server/driver,/selenium-server/driver]
>>> 14:03:35.079 INFO - Started
>>> HttpContext[/selenium-server,/selenium-server]
>>> 14:03:35.079 INFO - Started HttpContext[/,/]
>>> 14:03:35.089 INFO - Started SocketListener on 0.0.0.0:10000
>>> 14:03:35.090 INFO - Started org.mortbay.jetty.ser...@506c0c49
>>> Configure Selenium Client using configuration file
>>> 14:03:40.699 INFO - Stopping Acceptor ServerSocket[addr=
>>> 0.0.0.0/0.0.0.0,port=0,localport=10000]
>>> 14:03:40.794 INFO - Stopped SocketListener on 0.0.0.0:10000
>>> 14:03:41.229 INFO - Stopped
>>> HttpContext[/selenium-server/driver,/selenium-server/driver]
>>> 14:03:41.624 INFO - Stopped
>>> HttpContext[/selenium-server,/selenium-server]
>>> 14:03:41.977 INFO - Stopped HttpContext[/,/]
>>> 14:03:41.977 INFO - Stopped org.mortbay.jetty.ser...@506c0c49
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.924 sec
>>> <<< FAILURE!
>>>
>>> Results :
>>>
>>> Tests in error:
>>>
>>> createProjectFillingAllFields(gov.usgswim.biodata.test.ProjectPageTestCase)
>>>
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
>>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [ERROR] BUILD FAILURE
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] There are test failures.
>>>
>>> ***********************************************************
>>>
>>> Here's the surefire report:
>>>
>>>
>>> -------------------------------------------------------------------------------
>>> Test set: gov.usgswim.biodata.test.ProjectPageTestCase
>>>
>>> -------------------------------------------------------------------------------
>>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 9.923
>>> sec <<< FAILURE!
>>> createProjectFillingAllFields(gov.usgswim.biodata.test.ProjectPageTestCase)
>>> Time elapsed: 0.005 sec <<< ERROR!
>>> java.lang.NullPointerException: Cannot invoke method open() on null
>>> object
>>> at
>>> org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
>>> at
>>> org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:743)
>>> at
>>> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:720)
>>> at
>>> org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:17)
>>> at
>>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
>>> at
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
>>> at
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
>>> at
>>> org.tellurium.connector.SeleniumConnector.connectUrl(SeleniumConnector.groovy:47)
>>> at
>>> org.tellurium.test.java.BaseTelluriumJavaTestCase.connectUrl(BaseTelluriumJavaTestCase.java:50)
>>> at
>>> gov.usgswim.biodata.test.ProjectPageTestCase.connectToProjectPage(ProjectPageTestCase.java:44)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
>>> at
>>> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
>>> 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.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>>> at
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>>> at
>>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>>> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>>> at
>>> org.apache.maven.surefire.booter.SurefireBooter.run(SurefireBooter.java:241)
>>> at
>>> org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:537)
>>> at
>>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>>> at
>>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> at
>>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>> at
>>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>>
>>> Thanks in advance,
>>>
>>> Gabe
>>>
>>>
>>> On Tue, Aug 25, 2009 at 10:51 PM, Jian Fang <[email protected]>wrote:
>>>
>>>> Gabe,
>>>>
>>>> The wired thing is that I get back only one match for both XPath and
>>>> jQuery selector by using the html sources you posted for the diagnose
>>>> method. Please take a look at the trunk core code, more specifically,
>>>>
>>>>
>>>> http://code.google.com/p/aost/source/browse/trunk/core/src/test/groovy/example/other/GaGroupModule.groovy
>>>>
>>>>
>>>> http://code.google.com/p/aost/source/browse/trunk/core/src/test/groovy/example/test/java/GaTestCase.java
>>>>
>>>> Maybe my html source is too simple?
>>>>
>>>> Thanks,
>>>>
>>>> Jian
>>>>
>>>> On Tue, Aug 25, 2009 at 5:30 PM, Jian Fang <[email protected]>wrote:
>>>>
>>>>> Multiple matches mean that the generated runtime locator is not unique
>>>>> enough to specify the UI element. Could you send me the big html, which
>>>>> includes all the multiple matches, to my email account? I like to manually
>>>>> try the generated jQuery selector to see what is the problem. Hope it is
>>>>> not
>>>>> the jQuery selector group implementation problem.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Jian
>>>>>
>>>>>
>>>>> On Tue, Aug 25, 2009 at 4:58 PM, Gabriel Johnson <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> I'll try using XPath, but I'm still confused as to why I'm getting
>>>>>> multiple matches. If I'm using group locating and have unique text in the
>>>>>> title of each list, why do I match all five lists on the page?
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---