AOST - Beginner

6 views
Skip to first unread message

poweroftesting

unread,
May 13, 2009, 4:52:49 PM5/13/09
to tellurium-users
Hi,

I am a beginner to Tellurium but am a Selenium user, I am doing
something fundamentally wrong
trying to script Tellurium tests.

Where can I find some complete sample code for creating Tellurium
Test cases?
I am using Eclipse IDE to develop my tests. I am able to develop
Selenium Tests using JUnit.
But when I create GoogleStartPage.java I get syntax errors. My source
is below (taken from the
project home). Some of the errors I have documented in the source
below as comments.
I am using tellurium-core.0.6.0.RC1.jar in my class path. Any help is
greatly appreciated.

Regards,

Manoj

---------------------------------------------
GoogleStartPage.java-------------------------------------------------


import org.tellurium.dsl.DslContext;

class GoogleStartPage extends DslContext
{ // I am groovy-1.6.3.jar in class
path and it
//
wants me to declare this class as abstract
//
or add required setMetaClass abstract
//
methods.
public void defineUi() {
ui.Container(uid: "GooglePage")
{ // Unable to recognize 'ui'
which pkg should I
//
import?
InputBox(uid: "InputBox", locator: "//input
[@name='q']") // uid(String) undefined
Button(uid: "GoogleSearch", locator: "//input
[@name='btnG']") // change to getLocator()
Button(uid: "FeelingLucky", locator: "//input
[@name='btnI']")
}
}

public void doGoogleSearch(String input){
type "GooglePage.InputBox", input
click "GooglePage.GoogleSearch"
waitForPageToLoad 30000
}

public void doFeelingLucky(String input){
type "GooglePage.InputBox", input
click "GooglePage.FeelingLucky"
waitForPageToLoad 30000
}
}

Jian Fang

unread,
May 13, 2009, 5:01:25 PM5/13/09
to telluri...@googlegroups.com
Sounds like a Groovy version problem. Could you try Groovy 1.6.0 first?

The best way to create Tellurium project is to use Tellurium Maven archetypes, please see

http://code.google.com/p/aost/wiki/TelluriumMavenArchetypes

for details. The generated project includes a Tellurium test case for Google start page.

If you are not familiar with Maven, you can download one of our Reference projects.

Or you can download the demo file for the presentation "10 minutes to Tellurium" from

http://tellurium-users.googlegroups.com/web/demo.tar.gz?gda=iDKIRz0AAAD5mhXrH3CK0rVx4StVj0LYX-G77OBBcii9dCDKObpTUBlX3Fx9UEqM2hr2qeRv5GDlNv--OykrTYJH3lVGu2Z5&gsc=gTmdLSEAAAA1VzjU--gqc9_cubhWdIxHTSGPmsFZFSPyaHoWbGfcNUzfKN-m9S9niuHrq-IEXAE

Here is the introduction of the demo project

http://code.google.com/p/aost/wiki/TenMinutesToTellurium

Let us know if you still have problem to compile.

Thanks,

Jian

John

unread,
May 13, 2009, 5:21:24 PM5/13/09
to tellurium-users
// Unable to recognize 'ui'
Seems the tellurium core jar is not picked up by Eclipse.

You need to check your class path to make sure Tellurium Core jar is
in the project class path.

Here is the introduction of Groovy Eclipse plugin,

http://groovy.codehaus.org/Eclipse+Plugin

Have you installed that correctly? What is your version of Eclipse?

If you still have problem, I will try to reproduce it using the same
settings as yours.

Thanks,

Jian

Manoj Chavan

unread,
May 13, 2009, 5:33:15 PM5/13/09
to telluri...@googlegroups.com

Hi John,
Thanks for point this out. The Groovy plugin did not get installed correctly. I am using Eclipse 3.x.
I have re-installed it and will try again. Also, I downloaded the demo zip which has what I need. I
also found out that the *.groovy needs to be compiled using "groovyc" so will do that and see how
far I get. If I need any more help will holler .. thanks a lot.. this is a really cool framework long needed.
I am a advocate of selenium and now once I get to experience Tellurium will follow it religiously.

Keep up the gr8 work.

Manoj



----- Original Message ----
> From: John <John.Ji...@gmail.com>
> To: tellurium-users <telluri...@googlegroups.com>
> Sent: Wednesday, May 13, 2009 2:21:24 PM
> Subject: Re: AOST - Beginner
>
>
> // Unable to recognize 'ui'
> Seems the tellurium core jar is not picked up by Eclipse.
>
> You need to check your class path to make sure Tellurium Core jar is
> in the project class path.
>
> Here is the introduction of Groovy Eclipse plugin,
>
> http://groovy.codehaus.org/Eclipse+Plugin
>
> Have you installed that correctly? What is your version of Eclipse?
>
> If you still have problem, I will try to reproduce it using the same
> settings as yours.
>
> Thanks,
>
> Jian
>

Manoj Chavan

unread,
May 13, 2009, 5:58:49 PM5/13/09
to telluri...@googlegroups.com

HI,
Ok... I am much further along now... just need to run the tests. When I try to run via Eclipse as JUnit test
I get this msg : no tests found with test runner 'JUnit 4' .. I also tried with 'JUnit 3'. What else am I missing.
Thanks for your patience.

Regards
Manoj

--------------------------- My Test class -----------------------

package test;

import junit.framework.TestSuite;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.tellurium.test.java.TelluriumJavaTestCase;
import module.GoogleSearchModule;


/**
* Test cases created based on the GoogleSearchModule UI module
*/
public class GoogleSearchTestCase extends TelluriumJavaTestCase {
private static GoogleSearchModule gsm;

@BeforeClass
public static void initUi() {
gsm = new GoogleSearchModule();
gsm.defineUi();
}

@Before
public void connectToGoogle() {
connectUrl("http://www.google.com");
}

@Test
public void testGoogleSearchWithXPath() {
//turn off jQuery Selector
gsm.disableJQuerySelector();
gsm.doGoogleSearch("tellurium Groovy Test");
}

@Test
public void testGoogleSearchFeelingLuckyWithXPath() {
//turn off jQuery Selector
gsm.disableJQuerySelector();
gsm.doImFeelingLucky("tellurium automated Testing");
}

@Test
public void testGoogleSearchWithSelector() {
//turn on jQuery Selector
gsm.useJQuerySelector();
gsm.doGoogleSearch("tellurium Groovy Test");
}

@Test
public void testGoogleSearchFeelingLuckyWithSelector() {
//turn on jQuery Selector
gsm.useJQuerySelector();
gsm.doImFeelingLucky("tellurium automated Testing");
}

public static Test dssuite(){
TestSuite suite = new TestSuite();
System.out.println ("Adding Tests to a TestSuite.......");
suite.addTest(new MyBR("testGoogleSearchWithXPath"));
suite.addTest(new MyBR("testGoogleSearchFeelingLuckyWithXPath"));
suite.addTest(new MyBR("testGoogleSearchWithSelector"));
suite.addTest(new MyBR("testGoogleSearchFeelingLuckyWithSelector"));

return suite;

}
public static void main(String argv []){
public static void main(String args[]){
junit.textui.TestRunner.run(dssuite());
}
}
}



----- Original Message ----
> From: John <John.Ji...@gmail.com>
> To: tellurium-users <telluri...@googlegroups.com>
> Sent: Wednesday, May 13, 2009 2:21:24 PM
> Subject: Re: AOST - Beginner
>
>
> // Unable to recognize 'ui'
> Seems the tellurium core jar is not picked up by Eclipse.
>
> You need to check your class path to make sure Tellurium Core jar is
> in the project class path.
>
> Here is the introduction of Groovy Eclipse plugin,
>
> http://groovy.codehaus.org/Eclipse+Plugin
>
> Have you installed that correctly? What is your version of Eclipse?
>
> If you still have problem, I will try to reproduce it using the same
> settings as yours.
>
> Thanks,
>
> Jian
>

Jian Fang

unread,
May 13, 2009, 8:10:32 PM5/13/09
to telluri...@googlegroups.com
Hi Manoj,

Tellurium is still built on top of Selenium at the current stage and you should be able to get familiar with Tellurium pretty soon since you are good at Selenium.

Yes, you need to use groovyc to compile groovy files. If you look at our core build.xml and you should know how to do that using Ant. For Maven, it is handled by GMaven, but GMaven still has some problem and that is why I added the maven-ant-run plugin to customize it a bit using Ant.

Seems the reference project is a good starting point for you because it includes Intellij, Netbeans, and Eclipse project files as well as Ant and Maven build scripts. You can load it up using Eclipse directly once you have Groovy plugin installed.

Thanks,

Jian

Manoj Chavan

unread,
Jul 14, 2009, 4:16:25 PM7/14/09
to telluri...@googlegroups.com
Hi,
  I am trying to create a new project on a different machine and running into problems with archetype versions.
Below is the dump from the session.. I tried version 0.6.0 and 0.7.0-SNAPSHOT i keep getting the NotFoundException.

Regards,

Manoj


D:\workspace>mvn archetype:create -DgroupId=example -DartifactId=demo -Darchetyp
eArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVe
rsion=0.7.0
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus
.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:create]
[WARNING] This goal is deprecated. Please use mvn archetype:generate instead
[INFO] Defaulting package to group ID: example
Downloading: http://repo1.maven.org/maven2/tellurium/tellurium-junit-archetype/0
.7.0/tellurium-junit-archetype-0.7.0.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: org.apache.maven.archetype.downloader.DownloadNotFoundException:
 Requested download does not exist.
Unable to download the artifact from any repository
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Jul 14 13:13:14 PDT 2009
[INFO] Final Memory: 8M/14M
[INFO] ------------------------------------------------------------------------

From: Jian Fang <john.ji...@gmail.com>
To: telluri...@googlegroups.com
Sent: Wednesday, May 13, 2009 2:01:25 PM
Subject: Re: AOST - Beginner

Jian Fang

unread,
Jul 14, 2009, 4:22:39 PM7/14/09
to telluri...@googlegroups.com
Since Tellurium artifacts are hosted on Kungfuters.org, not repo1.maven.org, You need to add the Kungfuters.org repositories 
to your HOME/.m2/settings.xml or you project super POM file, i.e.,

                 
<repository>  
                   
<id>kungfuters-public-snapshots-repo</id>
                   
<name>Kungfuters.org Public Snapshot Repository</name>
                   
<releases>          
                       
<enabled>false</enabled>
                   
</releases>        
                   
<snapshots>        
                       
<enabled>true</enabled>
                   
</snapshots>        
                   
<url>http://kungfuters.org/nexus/content/repositories/snapshots</url>
               
</repository>  
               
<repository>    
                   
<id>kungfuters-public-releases-repo</id>
                   
<name>Kungfuters.org Public Releases Repository</name>
                   
<releases>          
                       
<enabled>true</enabled>
                   
</releases>        
                   
<snapshots>        
                       
<enabled>false</enabled>
                   
</snapshots>        
                   
<url>http://kungfuters.org/nexus/content/repositories/releases</url>
               
</repository>  
Alternatively, you can specify the Maven repository directly in Maven command without the above step.

For example, to use 0.6.0 release, use the following command,

mvn archetype:create -DgroupId=your_group_id -DartifactId=your_artifact_id -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0 -DarchetypeRepository=http://kungfuters.org/nexus/content/repositories/releases
Do the same for the 0.7.0 snapshot repo.

Thanks,

Jian

Jian Fang

unread,
Jul 14, 2009, 4:24:11 PM7/14/09
to telluri...@googlegroups.com
BTW, 0.7.0 snapshot may have not been uploaded. You better use the 0.6.0 release.

Manoj Chavan

unread,
Jul 14, 2009, 4:28:14 PM7/14/09
to telluri...@googlegroups.com
Thank you.. my settings.xml was name incorrectly...hence going to default repo1.

Regards,

Manoj

From: Jian Fang <john.ji...@gmail.com>
To: telluri...@googlegroups.com
Sent: Tuesday, July 14, 2009 1:24:11 PM
Subject: Re: AOST - Beginner

..7.0/tellurium-junit-archetype-0.7.0.jar

John

unread,
Jul 14, 2009, 4:33:28 PM7/14/09
to tellurium-users
Welcome. We will upload the 0.7.0 snapshot soon because the 0.7.0 core
snapshot includes a fix for
the hasCssClass method.

Thanks,

Jian

On Jul 14, 4:28 pm, Manoj Chavan <manoj_cha...@yahoo.com> wrote:
> Thank you.. my settings.xml was name incorrectly...hence going to default repo1.
>
> Regards,
>
> Manoj
>
>
>
> >From: Jian Fang <john.jian.f...@gmail.com>
> >To: telluri...@googlegroups.com
> >Sent: Tuesday, July 14, 2009 1:24:11 PM
> >Subject: Re: AOST - Beginner
>
> >>BTW, 0.7.0 snapshot may have not been uploaded. You better use the 0.6.0 release.
>
> >>mvn archetype:create -DgroupId=your_group_id -DartifactId=your_artifact_id -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.6.0-DarchetypeRepository=http://kungfuters.org/nexus/content/repositories/releases
>
> >>Do the same for the 0.7.0 snapshot repo.
>
> >>Thanks,
>
> >>Jian
>
> >>>.7.0/tellurium-junit-archetype-0.7.0.jar
> >>>[INFO] ------------------------------------------------------------------------
> >>>[ERROR] BUILD ERROR
> >>>[INFO]
> >>> ------------------------------------------------------------------------
> >>>[INFO] Error creating from archetype
>
> >>>Embedded error: org.apache.maven.archetype.downloader.DownloadNotFoundException:
> >>> Requested download does not exist.
>
> >>>Unable to download the artifact from any repository
> >>>[INFO] ------------------------------------------------------------------------
> >>>[INFO] For more information, run Maven with the -e switch
> >>>[INFO] ------------------------------------------------------------------------
>
> >>>[INFO] Total time: 5 seconds
> >>>[INFO] Finished at: Tue Jul 14 13:13:14 PDT 2009
> >>>[INFO] Final Memory: 8M/14M
> >>>[INFO] ------------------------------------------------------------------------
>
> >>>>From: Jian Fang <john.jian.f...@gmail.com>
> >>>>To: telluri...@googlegroups.com
> >>>>Sent: Wednesday, May 13, 2009 2:01:25 PM
> >>>>Subject: Re: AOST - Beginner
>
> >>>>>>>>Sounds like a Groovy version problem. Could you try Groovy 1.6.0 first?
>
> >>>>The best way to create Tellurium project is to use Tellurium Maven archetypes, please see
>
> >>>>http://code.google.com/p/aost/wiki/TelluriumMavenArchetypes
>
> >>>>for details. The generated project includes a Tellurium test case for Google start page.
>
> >>>>If you are not familiar with Maven, you can download one of our Reference projects.
>
> >>>>Or you can download the demo file for the presentation "10 minutes to Tellurium" from
>
> >>>>http://tellurium-users.googlegroups.com/web/demo.tar.gz?gda=iDKIRz0AA...
>
> >>>>Here is the introduction of the demo project
>
> >>>>http://code.google.com/p/aost/wiki/TenMinutesToTellurium
>
> >>>>Let us know if you still have problem to compile.
>
> >>>>Thanks,
>
> >>>>Jian
>

Jian Fang

unread,
Jul 14, 2009, 5:18:15 PM7/14/09
to tellurium-users
0.7.0-SNAPSHOT Maven archetypes have been uploaded.

For example, to create a TestNG project, use the following Maven command:

 mvn archetype:create -DgroupId=test -DartifactId=testngexample -DarchetypeArtifactId=tellurium-testng-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.7.0-SNAPSHOT -DarchetypeRepository=http://kungfuters.org/nexus/content/repositories/snapshots

Simliarly, use the following command for a new JUnit 4 project,

mvn archetype:create -DgroupId=test -DartifactId=junitexample -DarchetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -DarchetypeVersion=0.7.0-SNAPSHOT -DarchetypeRepository=http://kungfuters.org/nexus/content/repositories/snapshots

Please let us know if you run into any problems.

Thanks,

Jian

Manoj Chavan

unread,
Jul 14, 2009, 6:04:36 PM7/14/09
to telluri...@googlegroups.com
Thank you everyone, I am up and running and have my first tests running successfully on my 2nd
project using Tellurium ;)  keep up the gr8 work you all are doing.

Regards,

Manjo

From: Jian Fang <john.ji...@gmail.com>
To: tellurium-users <telluri...@googlegroups.com>
Sent: Tuesday, July 14, 2009 2:18:15 PM
Subject: Re: AOST - Beginner

Jian Fang

unread,
Jul 14, 2009, 9:12:51 PM7/14/09
to telluri...@googlegroups.com
Glad you got it working. Perhaps you could write a blog some time later to introduce your experience on Tellurium
so that more people could benefit from it.  In return we can give you the open source IntelliJ IDEA license for prompting
Tellurium.

Thanks,

Jian

Manoj Chavan

unread,
Jul 15, 2009, 2:31:43 PM7/15/09
to telluri...@googlegroups.com
Dont know if it is Maven issue or not.. but here is the problem I am facing. I wanted to set up
a project on a colleagues computer and while creating the mvn create ran into a problem
Attached in my settings.xml    I looked at the xml and could not find anything wrong with it.
Any pointers? Thank you.

Manoj

Command / Result.:

D:\workspace>mvn archetype:create -DgroupId=NetFlixId -DartifactID=NetFlix -Darc
hetypeArtifactId=tellurium-junit-archetype -DarchetypeGroupId=tellurium -Darchet
ypeVersion=0.6.0
---------------------------------------------------
constituent[0]: file:/D:/apache-maven-2.0.10/lib/maven-2.0.10-uber.jar
---------------------------------------------------
java.lang.ClassCastException: Settings.addActiveProfiles(string) parameter must
be instanceof java.lang.String
        at org.apache.maven.settings.Settings.addActiveProfile(Settings.java:112
)
        at org.apache.maven.settings.DefaultMavenSettingsBuilder.activateDefault
Profiles(DefaultMavenSettingsBuilder.java:198)
        at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(D
efaultMavenSettingsBuilder.java:178)
        at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(D
efaultMavenSettingsBuilder.java:154)
        at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(D
efaultMavenSettingsBuilder.java:142)
        at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:344)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:200)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.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)
settings.xml

Jian Fang

unread,
Jul 15, 2009, 2:39:01 PM7/15/09
to telluri...@googlegroups.com
We also noticed the same problem before. Seems Maven 2.0.10 is not fully compatible with Maven 2.0.9 and Tellurium is based on Maven 2.0.9. Please use Maven 2.0.9 for the time being. We will try to upgrade to Maven 2.0.10 later. I will create an issue for that.

Thanks,

Jian

Manoj Chavan

unread,
Jul 16, 2009, 2:17:09 PM7/16/09
to telluri...@googlegroups.com
Hi all now that I am on my way with my tests.. I have hit a speed bump... below is my module def.

ui.Form(uid: "login", clocator: [tag: "form", name: "login_form", method: "post"]){
            InputBox(uid: "uid", clocator: [tag: "input", type: "text", name: "email"])
            InputBox(uid: "pwd", clocator: [tag: "input", type: "password", name: "password1"])
            SubmitButton(uid: "submit", clocator: [tag: "input", type: "submit"], respond: ["click"])
            CheckBox(uid: "chkbox", clocator: [tag: "input", type: "checkbox", name: "RememberMe", id:    "RememberMe"])
        }

public void typeUid(String input){
         type "login.uid", input
     }
     
     public void typePwd(String input){
         type "login.pwd", input
     }
     
     public String getUid(){
         getValue "login.uid"
     }
     
     public void clickLogin(){
         click "login.submit"
         waitForPageToLoad 30000
     }     
     
     public String getCheckBoxStatus(){
         getValue "login.chkbox"
     }


// MY TEST CASE

@Test
    public void testLogin() {
        String sUid = "TestTest";
        String sPwd = "Testtest";
       
       
        System.out.println("No TESTS HAVE BEEN DEFINED>");
       
        nfhp.click("nfhp.hat.signin");
        nfhp.waitForPageToLoad(30000);
       
        nfhp.typeUid(sUid);
        nfhp.typePwd(sPwd);
       
       
        System.out.println("UID: " + nfhp.getUid());
        System.out.println("Check box state: " + nfhp.getCheckBoxStatus());
        nfhp.clickLogin();
    }

Dump locator information for login
-------------------------------------------------------
login: //descendant-or-self::form[@name="login_form"  and @method="post"]
login.uid: //descendant-or-self::form[@name="login_form" and @method="post"]/descendant-or-self::input[@type="text" and @name="email"]
login.pwd: //descendant-or-self::form[@name="login_form" and @method="post"]/descendant-or-self::input[@type="password" and @name="password1"]
login.submit: //descendant-or-self::form[@name="login_form" and @method="post"]/descendant-or-self::input[@type="submit"]
login.chkbox: //descendant-or-self::form[@name="login_form" and @method="post"]/descendant-or-self::input[@type="checkbox" and @name="RememberMe" and @id="RememberMe"]
-------------------------------------------------------
--------------------------------------  I get this error when clicking on the Submit Btn.
testLogin(test.NetFlixTestCase)  Time elapsed: 5.358 sec  <<< ERROR!
groovy.lang.MissingMethodException: No signature of method: org.tellurium.object.UiObject.getValue() is applicable for argument types: (org.tellurium.dsl.BaseDslContext$_getValue_closure36) values: [org.tellurium.dsl.BaseDslContext$_getValue_closure36@a6d35]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)


According to the User Guide, I should be able to use getValue for Checkbox.

Regards,

Manoj


From: Jian Fang <john.ji...@gmail.com>
To: telluri...@googlegroups.com
Sent: Tuesday, July 14, 2009 6:12:51 PM
Subject: Re: AOST - Beginner

Jian Fang

unread,
Jul 16, 2009, 2:40:11 PM7/16/09
to telluri...@googlegroups.com
It turned out that we forgot to add the getValue() method to the checkbox object. I just fixed it and published the jar to our Maven repo.
Please update your Tellurium core jar Maven repo. Be aware that you should use 0.7.0-SNAPSHOT.

Let us know if you have any further problems.

Thanks,

Jian

Manoj Chavan

unread,
Jul 16, 2009, 10:46:46 PM7/16/09
to telluri...@googlegroups.com
Hi ,
   I need some pointer on creating a module for the following html.

<ul id="primaryNav" class="navigation primaryNav clearfix">
http://www.mysite.com/MemberHome?lnkce=sntDd&lnkctr=mhbwse" title="Browse">
<span class="w1">
<span class="w2">Browse DVDs</span>
</span>
</a>
</li>
<li id="wnTab" class="navItem">

<span class="w1">
<span class="w2">Watch Instantly</span>
</span>
</a>
</li>
<li id="qTab" class="navItem">

<span class="w1">
<span class="w2">Your Queue</span>
</span>
</a>
</li>
<li id="rTab" class="navItem short">

<span class="w1">
<span class="w2">
Movies You'll
<span class="icon-love">Love</span>
</span>
</span>
</a>
</li>
</ul>



MY MODULE DEF

ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                UrlLink(uid: "browse", clocator: [tag: "a", text: "Browse DVDs"])
                UrlLink(uid: "watch", clocator: [tag: "a", text: "Watch Instantly"])
                UrlLink(uid: "queue", clocator: [tag: "a", text: "Your Queue"])
                UrlLink(uid: "mlove", clocator: [tag: "a", text: "Recommendations"])
            }               
 }


I tried this too..

ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Span(uid: "browse", clocator: [tag: "span", text: "Browse DVDs"])
                Span(uid: "watch", clocator: [tag: "span", text: "Watch Instantly"])
                Span(uid: "queue", clocator: [tag: "span", text: "Your Queue"])
                Span(uid: "mlove", clocator: [tag: "span", text: "Recommendations"])
            }               
 }

When I try to isElementPresent on 'mbrhome.navbar.queue' I get a failure... I tried the Span() definition also and it did not work. Any help greatly appreciated. I Know I could do a List array and click on navbar[i].
But if the order changes of the tab then that will not work.

Thanks a lot in advance.

Manoj

Jian Fang

unread,
Jul 16, 2009, 11:57:06 PM7/16/09
to tellurium-users
---------- Forwarded message ----------
From: Jian Fang <john.ji...@gmail.com>
Date: Thu, Jul 16, 2009 at 11:55 PM
Subject: Re: AOST - Beginner
To: Manoj Chavan <manoj_...@yahoo.com>


Sorry, there was an extra "," for the Container "browser" in the last post, please remove it. Then, you can try

click "mbrhome.navbar.browse".


ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Container(uid: "browse", clocator: [tag: "a", title: "Browse"], group: "true", respond: ["click"]){
                     Span(uid: "browseDVDs", clocator: [tag: "span", text: "Browse DVDs"])
                }

                ......


            }               
 }

On Thu, Jul 16, 2009 at 11:52 PM, Jian Fang <john.ji...@gmail.com> wrote:
If each sub section likes the following,

<li>
<a  href="http://www.mysite.com/MemberHome?lnkce=sntDd&lnkctr=mhbwse" title="Browse">


<span class="w1">
<span class="w2">Browse DVDs</span>
</span>
</a>
</li>

Then, you can try

ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Container(uid: "browse", clocator: [tag: "a", title: "Browse"], group: "true",, respond: ["click"]){

                     Span(uid: "browse", clocator: [tag: "span", text: "Browse DVDs"])
                }

                ......

            }               
 }

Let me know if this works for you.

Thanks,

Jian


On Thu, Jul 16, 2009 at 11:20 PM, Jian Fang <john.ji...@gmail.com> wrote:
Seems some part is missing for the following section

Please post it again.

Thanks,

Jian

On Thu, Jul 16, 2009 at 6:48 PM, Manoj Chavan <manoj_...@yahoo.com> wrote:
Hi John,

Jian Fang

unread,
Jul 17, 2009, 4:51:42 PM7/17/09
to tellurium-users, Manoj Chavan
Actually, since your URL links come with the title attribute, you do not really need to use their child attribute for locating.

For example, you can try the UI module

ui.Container(uid: "mainnav", clocator:[ tag: "div",id:"mainNavigation"]){
   Container(uid:"navtabs",clocator:[tag:"ul",id:"primaryNav"]){
       UrlLink(uid: "browse", clocator: [title: "Browse DVDs")
       UrlLink(uid: "watch", clocator: [title: "^Watch movies"]
       UrlLink(uid: "queue", clocator: [
title: "Your Queue"]
   }
}

Be aware, if the title in the html may include extra character, then you should use partial matching.

Thanks,

Jian

On Fri, Jul 17, 2009 at 4:06 PM, Manoj Chavan <manoj_...@yahoo.com> wrote:
Hi John,
   Thank u for the help... It still says element not found.

Here is the HTML again

<div id="mainNavigation">
<ul id="primaryNav" class="navigation primaryNav clearfix">
    <li id="bTab" class="navItem navItem-current">
        <a href="http://www.mysite.com/MemberHome?lnkce=sntDd&lnkctr=mhbwse" title="Browse DVDs">
            <span class="w1">
                <span class="w2">Browse DVDs</span>
            </span>
        </a>
    </li>
    <li id="wnTab" class="navItem">
        <a href="http://www.mysite.com/WiHome?lnkctr=mhWN&lnkce=sntWi" title="Watch movies instantly on your PC">
            <span class="w1">
                <span class="w2">Watch Instantly</span>
            </span>
        </a>
    </li>
    <li id="qTab" class="navItem">
        <a href="http://www.mysite.com/Queue?lnkce=sntQu&lnkctr=mhbque" title="Your Queue">
            <span class="w1">
                <span class="w2">Your Queue</span>
            </span>
        </a>
    </li>
</ul>
</div>

I modified ur module def to this

ui.Container(uid: "mainnav", clocator: [tag: "div",  id: "mainNavigation"]){

            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Container(uid: "browse", clocator: [tag: "a", title: "Browse DVDs"], group: "true", respond: ["click"]){

                     Span(uid: "browseDVDs", clocator: [tag: "span", text: "Browse DVDs"])
                }

                ......

            }               
 }

click "mainnav.navbar.browse"    did not work....

I  tried this method and it seems to be working, only thing is if the order of the tabs changes then I have
re-write the instruction in the test case clicking on the tested tab...

ui.Container(uid: "mainnav", clocator:[ tag: "div",id:"mainNavigation"]){
   List(uid:"navtabs",clocator:[tag:"ul",id:"primaryNav"],separator:"li"){
       urlLink(uid:"all",clocator:[:]
   }
}

        click "mainnav.navtabs[3]"

did the trick. Now my only concern is if the order changes then what?

Regards,

Manoj

From: Jian Fang <john.ji...@gmail.com>
To: Manoj Chavan <manoj_...@yahoo.com>
Sent: Thursday, July 16, 2009 8:55:42 PM
Subject: Re: AOST - Beginner

Sorry, there was an extra "," for the Container "browser" in the last post, please remove it. Then, you can try

click "mbrhome.navbar.browse".

ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Container(uid: "browse", clocator: [tag: "a", title: "Browse"], group: "true", respond: ["click"]){
                     Span(uid: "browseDVDs", clocator: [tag: "span", text: "Browse DVDs"])
                }

                ......

            }               
 }

On Thu, Jul 16, 2009 at 11:52 PM, Jian Fang <john.ji...@gmail.com> wrote:
If each sub section likes the following,

<li>
<span class="w1">
<span class="w2">Browse DVDs</span>
</span>
</a>
</li>

Then, you can try

ui.Container(uid: "mbrhome", clocator: [tag: "body",  id: "page-MemberHome"]){
            Container(uid: "navbar", clocator: [tag: "ul", id: "primaryNav"]){
                Container(uid: "browse", clocator: [tag: "a", title: "Browse"], group: "true",, respond: ["click"]){

                     Span(uid: "browse", clocator: [tag: "span", text: "Browse DVDs"])
                }

                ......

            }               
 }

Let me know if this works for you.

Thanks,

Jian


On Thu, Jul 16, 2009 at 11:20 PM, Jian Fang <john.ji...@gmail.com> wrote:
Seems some part is missing for the following section

Please post it again.

Thanks,

Jian

John

unread,
Jul 17, 2009, 5:12:55 PM7/17/09
to tellurium-users
In 0.7.0, we will use attribute/alias besides the index to refer a
List element.
The same should apply to other UIs that use UI templates such as
table.
In this way, the position changes should not affect your test code any
more.

On Jul 17, 4:51 pm, Jian Fang <john.jian.f...@gmail.com> wrote:
> Actually, since your URL links come with the title attribute, you do not
> really need to use their child attribute for locating.
>
> For example, you can try the UI module
>
> ui.Container(uid: "mainnav", clocator:[ tag: "div",id:"mainNavigation"]){
>    Container(uid:"navtabs",clocator:[tag:"ul",id:"primaryNav"]){
>        UrlLink(uid: "browse", clocator: [title: "Browse DVDs")
>        UrlLink(uid: "watch", clocator: [title: "^Watch movies"]
>        UrlLink(uid: "queue", clocator: [title: "Your Queue"]
>    }
>
> }
>
> Be aware, if the title in the html may include extra character, then you
> should use partial matching.
>
> Thanks,
>
> Jian
>
> > *From:* Jian Fang <john.jian.f...@gmail.com>
> > *To:* Manoj Chavan <manoj_cha...@yahoo.com>
> > *Sent:* Thursday, July 16, 2009 8:55:42 PM
> > *Subject:* Re: AOST - Beginner
> >> On Thu, Jul 16, 2009 at 11:20 PM, Jian Fang <john.jian.f...@gmail.com>wrote:
>
> >>> Seems some part is missing for the following section
>
> >>>http://www.mysite.com/MemberHome?lnkce=sntDd&lnkctr=mhbwse"
> >>> title="Browse">
>
> >>> Please post it again.
>
> >>> Thanks,
>
> >>> Jian
>
Reply all
Reply to author
Forward
0 new messages