Hello John!
Thank you for the code, but it still not working for me. I'm thinking
that this must be some environmental / project setting problem.
So I tried to:
- run your code in my project (custom project, no maven)
- run your code in your in your project (maven, which you linked
above)
- run my code in your project
All runs have failed with the same error I posted before.
Well I have some remark and question that can maybe help.
My Environment: WinXP 32 bit, Eclipse 3.4.1, testNG
I read the tutorial about the Custom Tellurium Testng project, and
tried some variations, so as far as I see, the fundamentals in the
project are:
- add the basic libs to the project:
system jre/jdk(with maven), selenium-java-client-driver.jar,
selenium-server.jar, tellurium-0.6.0.jar, testng-5.7(or8)-jdk15.jar,
groovy-1.6.0.jar
- you have to have the Groovy plugin installed in eclipse
i)Here I have a question with groovy:
- now if I add groovy nature to the project before I add the proper
jars to the project than the plugin will import its own groovy library
from the eclipse/plugins directory to the project, which is older than
1.6.0 (it shows under: java build path/ libraries tab / expand "groovy
libraries")
This is the case also if I import the maven project you linked
above, because maven referenced libraries are grouped together, so the
groovy.1.6.0.jar is not shown amongst the java build path / libraries
tab, it's under the Maven Dependencies. Here the groovy nature already
added, but insted the Import Groovy libs into the project does the
same - it imports the groovy-...jar - from the eclipse/plugin dir.
- No problem I can workaround this:
In custom project import the libs before adding groovy nature.
With maven project, make a lib directory copy the jar there, and
import it as external(or internal) jar to the project and than there
will be groovy-1.6.0 support.
So this is my question if I get this right, and this type of adding
groovy nature to the project is good.
If I'm correct than for a clean project I make a new java project, add
the basic jars, add groovy nature(the groovy build path is set by
default), copy the TelluriumConfig.groovy to the project root and
thats it. I should have the code running.
-Maybe I'm using the wrong jars?
All the jars I use, are from the svn repository / core / lib
directory - should be good.
- If I make any changes I clean the project / rebuild. Or purge the
groovy-bin dir to recompile the groovy files.
- So I get the same error. Maybe some problem with testNG? or my
Eclipse (started from clean eclipse) or? Any suggestions?
Thank you!
Istvan
p.s.: Tho we like Tellurium's new approach to web testing here at the
company. Great work guys!
On May 4, 9:45 pm, John <[email protected]> wrote:
> My test code is uploaded and you can download it from here,
>
> http://tellurium-users.googlegroups.com/web/IssueSearch.tar.gz?gda=7P...
>
> On May 4, 3:38 pm, John <[email protected]> wrote:
>
> > I created an example project to define the Tellurium issue modules in
> > two module files,
>
> > public class IssueSearchModule extends DslContext{
>
> > public void defineUi() {
>
> > //define UI module of a form include issue type selector and
> > issue search
> > ui.Form(uid: "issueSearch", clocator: [action: "list", method:
> > "get"], group: "true") {
> > Selector(uid: "issueType", clocator: [name: "can", id:
> > "can"])
> > TextBox(uid: "searchLabel", clocator: [tag: "span", text:
> > "*for"])
> > InputBox(uid: "searchBox", clocator: [type: "text", name:
> > "q", id: "q"])
> > SubmitButton(uid: "searchButton", clocator: [value:
> > "Search"])
> > }
> > }
>
> > public String[] getIsssueTypes(){
> > return getSelectOptions("issueSearch.issueType")
> > }
>
> > public void searchIssue(String issue){
> > clearText "issueSearch.searchBox"
> > type "issueSearch.searchBox", issue
> > click "issueSearch.searchButton"
> > }
>
> > }
>
> > public class IssueSearchResultModule extends DslContext {
>
> > public void defineUi() {
> > ui.Table(uid: "issueResult", clocator: [id: "resultstable",
> > class: "results"], group: "true") {
> > //define table header
> > //for the border column
> > TextBox(uid: "header: 1", clocator: [:])
> > UrlLink(uid: "header: 2", clocator: [text: "*ID"])
> > UrlLink(uid: "header: 3", clocator: [text: "*Type"])
> > UrlLink(uid: "header: 4", clocator: [text: "*Status"])
> > UrlLink(uid: "header: 5", clocator: [text: "*Priority"])
> > UrlLink(uid: "header: 6", clocator: [text: "*Milestone"])
> > UrlLink(uid: "header: 7", clocator: [text: "*Owner"])
> > UrlLink(uid: "header: 9", clocator: [text: "*Summary +
> > Labels"])
> > UrlLink(uid: "header: 10", clocator: [text: "*..."])
>
> > //define table elements
> > //for the border column
> > TextBox(uid: "row: *, column: 1", clocator: [:])
> > TextBox(uid: "row: *, column: 8", clocator: [:])
> > TextBox(uid: "row: *, column: 10", clocator: [:])
> > //For the rest, just UrlLink
> > UrlLink(uid: "all", clocator: [:])
> > }
> > }
>
> > //simulate your method
> > public boolean waitForAjax() {
> > String element = "issueResult[1][1]";
> > int timeout = 30000;
> > waitForElementPresent(element, timeout)
> > return isElementPresent(element)
> > }
>
> > public void clickTable(int row, int column){
> > click "issueResult[${row}][${column}]"
> > }
>
> > public void clickOnTableHeader(int column){
> > click "issueResult.header[${column}]"
> > }
>
> > }
>
> > Then, the Test class is as follows,
>
> > public class IssueSearchTest extends TelluriumTestNGTestCase {
> > private static IssueSearchModule ism;
> > private static IssueSearchResultModule isrm;
>
> > @BeforeClass
> > public static void initUi() {
> > ism = new IssueSearchModule();
> > ism.defineUi();
> > isrm = new IssueSearchResultModule();
> > isrm.defineUi();
> > }
>
> > @BeforeMethod
> > public final void beforeMethod() {
> > connectUrl("http://code.google.com/p/aost/issues/list");
> > }
>
> > @Test
> > public void testSearchIssue(){
> > String[] ists = ism.getIsssueTypes();
> > ism.searchIssue("TrUMP");
> > isrm.waitForAjax();
> > isrm.clickTable(1, 2);
> > }
>
> > }
>
> > I run the test and it passed. I cannot reproduce your problem here. If
> > you
> > need, I can upload the code to our user group so that you can test it
> > in
> > your environment.
>
> > Would it be possible it is your IDE problem? For example, in IntelliJ
> > IDEA,
> > sometimes, you need to run "build project" to regenerate the java
> > classes from groovy
> > classes to make the test running.
>
> > Thanks,
>
> > Jian
>
> > On May 4, 5:56 am, Istvan_Pamer <[email protected]> wrote:
>
> > > Hello!
>
> > > I have a problem with using multiple page definitions in a single test
> > > group (class). I did like you mentioned above, but it throws an
> > > exception for me if the page definitions are splitted into multiple
> > > definition files. If I copy the definitions into one file without
> > > modifications, than it works fine.
> > > Let me copy the code here:
>
> > > The two definition files:
> > > =======================
> > > Homepage:
> > > import org.tellurium.dsl.DslContext
> > > public class Homepage extends DslContext {
> > > public void defineUi() {
> > > ui.Form(uid: "root", clocator: [tag: "form", id:
> > > "searchForm", name:
> > > "searchForm"]){
> > > InputBox(uid: "input0", clocator: [tag: "input",
> > > type: "text",
> > > class: "width230", id: "Fcity1", name: "destination"], respond:
> > > ["keyDown", "click"])
> > > SubmitButton(uid: "button1", clocator: [tag:
> > > "button", text:
> > > "Go", type: "submit", id: "btnHomeSubmit"])
> > > }
> > > }
>
> > > public void searchCity(String city){
> > > type "root.input0", city
> > > pause 500
> > > click "root.button1"
> > > waitForPageToLoad 30000
> > > }}
>
> > > ---------------------------------------------------------
> > > SearchResultPage:
> > > import org.tellurium.dsl.DslContext
> > > public class SearchResultPage extends DslContext {
> > > public void defineUi() {
> > > ui.Container(uid: "main_content", clocator: [tag: "div", id:
> > > "main_content"]){
> > > List(uid: "twoColLeft", clocator: [tag: "div", id:
> > > "twoColLeftContainer"], separator: "d...@class='resultBox']"){
> > > UrlLink(uid: "all", clocator: [tag: "a"])
> > > }
> > > }
> > > }
>
> > > public boolean waitForAjax() {
> > > String element = "main_content.twoColLeft[1]";
> > > int timeout = 30000;
> > > waitForElementPresent(element, timeout)
> > > return isElementPresent(element)
> > > }
>
> > > public void clickSearchResultLink() {
> > > click("main_content.twoColLeft[1]")
> > > waitForPageToLoad 30000
> > > }}
>
> > > ======================
> > > The Test file:
> > > import ...Homepage;
> > > import ...SearchResultPage;
> > > public class TestBooking extends TelluriumTestNGTestCase {
> > > private static Homepage homepage;
> > > private static SearchResultPage srp;
>
> > > @BeforeClass
> > > public static void initUi() {
> > > homepage = new Homepage();
> > > homepage.defineUi();
> > > srp = new SearchResultPage();
> > > srp.defineUi();
> > > }
>
> > > @BeforeMethod
> > > public final void beforeMethod() {
> > > connectUrl("...");
> > > }
>
> > > @Test
> > > public final void testBooking() {
> > > homepage.searchCity("london");
> > > srp.waitForAjax();
> > > srp.clickSearchResultLink();
> > > }}
>
> > > =============================
>
> > > groovy.lang.MissingMethodException: No signature of
> > > method: .................module.Homepage.waitForElementPresent() is
> > > applicable for argument types: (java.lang.String, java.lang.Integer)
> > > values: [main_content.twoColLeft[1], 30000]
> > > at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap
> > > (ScriptBytecodeAdapter.java:54)
> > > at
> > > org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN
> > > (ScriptBytecodeAdapter.java:90)
> > > at ....................module.SearchResultPage.waitForAjax
> > > (SearchResultPage.groovy:37)
> > > at
> > > ....................test.TestBooking.testBooking(TestBooking.java:
> > > 86)
>
> > > - It says that no method signature for waitForElementPresent() in the
> > > Homepage module - but there is no such method call in the Homepage
> > > module. The waitForElementPresent method call occurs on the
> > > SearchResultPage.
> > > - If I put the two definition files together in a separate one, import
> > > it to the test and call the methods, than it runs just fine.
>
> > > Is it a bug? Or I'm the one who making some mistake?
>
> > > Thank for the help in advance!
> > > Best regards,
> > > Istvan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---