Thanks Jian, Will do this and let you know how it works for me.
Regards, Manoj > >From: Jian Fang <[email protected]> >To: [email protected] >Sent: Thu, July 15, 2010 5:29:44 PM >Subject: Re: Selenium waitForAjax () question? > >Cool. First, you need to register your api in the following method: > >Tellurium.prototype.registerTeApis = function(){ > this.registerApi("isElementPresent", true, "BOOLEAN"); > this.registerApi("blur", true, "VOID"); >... >} > >where the function is defined as > >Tellurium.prototype.registerApi = function(apiName, requireElement, returnType){ > >apiName is your method name, requireElement means your method requires a >locator, and returnType is of > >of the following values: [STRING, BOOLEAN, NUMBER, OBJECT, ARRAY, VOID]. > >Then, in Tellurium core BaseDslContext.groovy defines a method similar to the >following one: > > int getTeRepeatNum(String uid){ > WorkflowContext context = >WorkflowContext.getContextByEnvironment(this.exploreCssSelector(), >this.exploreUiModuleCache()) > walkToWithException(context, uid) > > return extension.getRepeatNum(context, uid) > } > >Note that you should pass it to the extension tier so that you don't need to >define a new method in different tiers since the extension >tier simply passes all commands it receives to the Engine. > >After that, you should be able to call your method from any class that extends >the DslContext class. > >Let us know if you have further questions. > >Thanks, > >Jian > > >On Thu, Jul 15, 2010 at 7:27 PM, Manoj Chavan <[email protected]> wrote: > >Hi Jian >> >> I created two prototype functions in tellurium-api.js, was wondering how >> to >>call them in my JUnit >>tests? >> >>Regards, >> >>Manoj >> >> >> >> >>> >>>From: Jian Fang <[email protected]> >>>To: [email protected] >>>Sent: Wed, July 14, 2010 12:52:43 PM >>> >>>Subject: Re: Selenium waitForAjax () question? >>> >>> >>>Not sure if that works. You better to create a new custom selenium method in >>>user_extensions.js or the tellurium-extension.js >>>in the Engine for Selenium Core apis. For new Engine APIs, you can modify >>>the >>>tellurium-api.js and register the api. >>> >>> >>>Thanks, >>> >>>Jian >>> >>> >>>On Wed, Jul 14, 2010 at 3:47 PM, Manoj Chavan <[email protected]> wrote: >>> >>>Question? When using the .waitForCondition() as below, it does not seem to >>>work. >>>Wanted to >>>>know if the selenium JScript can be called like this? OR do I need to add a >>>>new >>>>def in user_extensions.js? >>>> >>>>mbh.waitForCondition("selenium.browserbot.getCurrentWindow().jQuery.active >>>>== >>>>0", 10000); >>>> >>>> >>>>Regards, >>>> >>>>Manoj >>>> >>>>ps: I have downloaded the project from the repository and once I figure out >>>>where to add this >>>> >>>>will submit the method for review. >>>> >>>> >>>>> >>>>>From: Jian Fang <[email protected]> >>>>>To: [email protected] >>>>>Sent: Mon, July 12, 2010 2:29:50 PM >>>>>Subject: Re: Selenium waitForAjax () question? >>>>> >>>>> >>>>>Tellurium new Engine uses jQuery and you are welcome to add >>>>>waitForAjaxToComplete() >>>>> >>>>>and then contribute it back to us. >>>>> >>>>>We have a similar issue open, but no one works on it now. >>>>> >>>>>http://code.google.com/p/aost/issues/detail?id=145 >>>>> >>>>>Thanks, >>>>> >>>>>Jian >>>>> >>>>> >>>>>On Mon, Jul 12, 2010 at 5:24 PM, Manoj Chavan <[email protected]> >wrote: >>>>> >>>>>Hi, >>>>>> >>>>>> Wanted to find out which javascript library is Tellurium using >(Prototype, >>>>>>dojo, jquery)? >>>>>>I wanted to add some functions for waitForAjaxToComplete() for the >>>>>>selenium-server. Or >>>>>>is there a better way via Tellurium to wait for all Ajax queries to >>>>>>complete >>>>on >>>>>>a page load >>>>>>before proceeding? >>>>>> >>>>>>Regards, >>>>>> >>>>>>Manoj >>>>>> >>>>>> >>>>>>-------------code from web --------- >>>>>> >>>>>> >>>>>>def wait_for_ajax(timeout=5000) >>>>>>>js_condition = “selenium.browserbot.getCurrentWindow().jQuery.active == >0” >>>>>>>$selenium.wait_for_condition(js_condition, timeout) >>>>>>>end >>>>>> >>>>>>-- >>>>>>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. >>>>>> >>>>>> >>>>> -- >>>>> >>>>>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. >>>>> -- >>>> >>>>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. >>>> >>> -- >>> >>>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. >>> >> -- >>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. >> > -- >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. > -- 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.
