If both are false, will I still be able to call getValue on all elements? If useTelluriumEngine(false) is set, then are the methods discussed in the User Guide still available?
Jade On Sep 8, 8:27 am, Jian Fang <[email protected]> wrote: > Hi Jade, > > If you are not using Tellurium Engine, you should not use the Tellurium > apis. As I replied in another > thread, useTelluriumEngine(isUse) calls couple APIs under the hood and thus, > you should remove > > useTelluriumApi(true); > useCache false > > You can also remove the following line if you use 0.8.0 core snapshot > useCssSelector(true); > > since CSS selector is the default locator for 0.8.0 core. > > Thanks, > > Jian > > On Wed, Sep 8, 2010 at 9:08 AM, Jade <[email protected]> wrote: > > If useTelluriumEngine(false) is set in my TelluriumDataDrivenTest > > subclass as such: > > > public void testDataDriven() { > > > // If you are not using Tellurium Engine, you don't need to > > use > > cache. > > useTelluriumEngine(false); > > > useTrace(true); > > > includeModule > > org.tdl.vireo.webtest.datadriventests.module.DspaceLogonModule.class > > includeModule > > > org.tdl.vireo.webtest.datadriventests.module.admin.DegreeInformationModule.class > > > when I try to reference the first module to interact with it, I get > > this error: > > > com.thoughtworks.selenium.SeleniumException: ERROR: Cannot find UI > > Module DspaceLoginForm > > message: Cannot find UI Module DspaceLoginForm, name: Error, filename: > >http://localhost:4444/selenium-server/core/scripts/htmlutils.js, > > linenumber: 814. > > JavaScript Error Stack: > > SeleniumError("Cannot find UI Module DspaceLoginForm")@http:// > > localhost:4444/selenium-server/core/scripts/htmlutils.js:814 > > > However, the module is found during the diagnose call: > > > ------------------------------------------------------- > > > TE: Name: getValidateUiModule, start: 1283950692341, duration: 199ms > > TE: Name: getValidateUiModule, start: 1283950692341, duration: 199ms > > > UI Module Validation Result for DspaceLoginForm > > > ------------------------------------------------------- > > > Found Exact Match: true > > > Found Closest Match: false > > > Match Count: 1 > > > Match Score: 100 > > > and to toString and toJSONArray results: > > > [{"obj":{"uid":"DspaceLoginForm","locator":{"tag":"form","attributes": > > {"id":"aspect_eperson_PasswordLogin_div_login","action":"xmlui/ > > password-login","class":"ds-interactive-div > > primary","method":"post"}},"uiType":"Form","metaData": > > {"id":"DspaceLoginForm","type":"UiObject"}},"key":"DspaceLoginForm"}, > > {"obj":{"uid":"LoginPassword","locator":{"tag":"input","attributes": > > > {"id":"aspect_eperson_PasswordLogin_field_login_password","name":"login_password","class":"ds- > > password-field","type":"password"}},"uiType":"InputBox","metaData": > > > {"id":"LoginPassword","type":"UiObject"}},"key":"DspaceLoginForm.LoginPassword"}, > > {"obj":{"uid":"LoginEmail","locator":{"tag":"input","attributes": > > > {"id":"aspect_eperson_PasswordLogin_field_login_email","name":"login_email","class":"ds- > > text-field","type":"text"}},"uiType":"InputBox","metaData": > > {"id":"LoginEmail","type":"UiObject"}},"key":"DspaceLoginForm.LoginEmail"}, > > {"obj":{"uid":"Submit","locator": > > {"direct":true,"tag":"input","attributes": > > > {"id":"aspect_eperson_PasswordLogin_field_submit","name":"submit","value":"Sign > > in","class":"ds-button- > > field","type":"submit"}},"uiType":"SubmitButton","metaData": > > {"id":"Submit","type":"UiObject"}},"key":"DspaceLoginForm.Submit"}] > > [[obj:[uid:DspaceLoginForm, locator:[tag:form, attributes: > > [id:aspect_eperson_PasswordLogin_div_login, action:"xmlui/password- > > login", class:ds-interactive-div primary, method:post]], uiType:Form, > > metaData:[id:DspaceLoginForm, type:UiObject]], key:DspaceLoginForm], > > [obj:[uid:LoginPassword, locator:[tag:input, attributes: > > [id:aspect_eperson_PasswordLogin_field_login_password, > > name:login_password, class:ds-password-field, type:password]], > > uiType:InputBox, metaData:[id:LoginPassword, type:UiObject]], > > key:DspaceLoginForm.LoginPassword], [obj:[uid:LoginEmail, locator: > > [tag:input, attributes: > > [id:aspect_eperson_PasswordLogin_field_login_email, name:login_email, > > class:ds-text-field, type:text]], uiType:InputBox, metaData: > > [id:LoginEmail, type:UiObject]], key:DspaceLoginForm.LoginEmail], [obj: > > [uid:Submit, locator:[direct:true, tag:input, attributes: > > [id:aspect_eperson_PasswordLogin_field_submit, name:submit, value:Sign > > in, class:ds-button-field, type:submit]], uiType:SubmitButton, > > metaData:[id:Submit, type:UiObject]], key:DspaceLoginForm.Submit]] > > TE: Name: getDiagnosisResponse, start: 1283950691680, duration: 106ms > > TE: Name: getDiagnosisResponse, start: 1283950691680, duration: 106ms > > > Here's my module file: > > > package org.tdl.vireo.webtest.datadriventests.module > > > import org.telluriumsource.test.ddt.TelluriumDataDrivenModule > > import org.apache.log4j.Logger > > import org.tdl.vireo.webtest.datadriventests.VireoTestConfig; > > import org.tdl.vireo.webtest.datadriventests.AdminPageTitle; > > > /** > > * This UI module file is created for logging into Dspace. > > */ > > > public class DspaceLogonModule extends TelluriumDataDrivenModule { > > > static Logger log = Logger.getLogger(DspaceLogonModule.class); > > > public void defineModule() { > > > String postAction = > > "\"${VireoTestConfig.getWebApp()}/password-login > > \"" > > > ui.Form(uid: "DspaceLoginForm", clocator: [tag: "form", > > method: > > "post", action: "$postAction", class: "ds-interactive-div primary", > > id: "aspect_eperson_PasswordLogin_div_login"]){ > > InputBox(uid: "LoginEmail", clocator: [tag: "input", > > type: "text", > > name: "login_email", class: "ds-text-field", id: > > "aspect_eperson_PasswordLogin_field_login_email"]) > > InputBox(uid: "LoginPassword", clocator: [tag: > > "input", type: > > "password", name: "login_password", class: "ds-password-field", id: > > "aspect_eperson_PasswordLogin_field_login_password"]) > > SubmitButton(uid: "Submit", clocator: [tag: "input", > > direct: > > "true", type: "submit", value: "Sign in", name: "submit", class: "ds- > > button-field", id: "aspect_eperson_PasswordLogin_field_submit"]) > > } > > > // ui.Form(uid: "DspaceLoginFormWithError", > > clocator: [tag: "form", > > method: "post", action: "xmlui", class: "ds-interactive-div primary", > > id: "aspect_eperson_PasswordLogin_div_login"]){ > > // Span(uid: "Error", clocator: [tag: > > "span", class: "error"]) > > // } > > // > > ui.Container(uid: "LoginOrOut", clocator: [id: > > "ds-user-box"]) { > > ui.UrlLink(uid: "Profile", clocator: [tag: "a", > > text: "Profile*"]) > > ui.UrlLink(uid: "Login", clocator: [tag: "a", text: > > "Login"]) > > ui.UrlLink(uid: "Logout", clocator: [tag: "a", text: > > "Logout"]) > > } > > > // file format definition > > fs.Fieldset(name: "DspaceLogin", description: "Login form > > for > > Dspace") { > > Test(value: "login") > > Field(name: "email") > > Field(name: "password") > > Field(name: "isValidLogonData", type: boolean, > > description: "true > > if this data is valid") > > } > > > fs.Fieldset(name: "DspaceLogout", description: "Log out of > > Dspace") > > { > > Test(value: "logout") > > Field(name: "email") > > } > > > defineTest("login") { > > try { > > connectUrl > > "${VireoTestConfig.getTestUrl()}/password-login" > > > String email = bind("DspaceLogin.email") > > String password = > > bind("DspaceLogin.password") > > boolean isValidLogonData = > > bind("DspaceLogin.isValidLogonData") > > > log.debug "login ${email} ${password} > > ${isValidLogonData}" > > > println toString("DspaceLoginForm") > > println toJSONArray("DspaceLoginForm") > > diagnose("DspaceLoginForm.LoginEmail") > > diagnose "DspaceLoginForm.LoginPassword" > > validate "DspaceLoginForm" > > > //useTelluriumEngine(true) > > type "DspaceLoginForm.LoginEmail", email > > pause VireoTestConfig.getPauseTime() > > > type "DspaceLoginForm.LoginPassword", > > password > > pause VireoTestConfig.getPauseTime() > > > click "DspaceLoginForm.Submit" > > waitForPageToLoad > > VireoTestConfig.getMaxWait() > > > if (!isValidLogonData) { > > > assertEquals(AdminPageTitle.LOGIN.getTitle(), getTitle()) > > > //assertTrue(isElementPresent("DspaceLoginFormWithError.Error")) > > } else { > > > assertEquals(AdminPageTitle.DSPACE_HOME.getTitle(), getTitle()) > > > //assertTrue(isElementPresent("LoginOrOut.Logout")) > > } > > } catch (Exception e) { > > fail(e.getMessage()) > > } > > } > > > defineTest("logout") { > > > connectUrl "${VireoTestConfig.getTestUrl()}" > > > // All data driven tests must have one piece of data > > even though > > we're not using this here. > > String email = bind("DspaceLogout.email") > > > if (isElementPresent("LoginOrOut.Logout")) { > > click "LoginOrOut.Logout" > > waitForPageToLoad > > VireoTestConfig.getMaxWait() > > > assertTrue(isElementPresent("LoginOrOut.Login")) > > ... > > read more » -- 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.
