That is kinda strange. Seems the locate function has returned to Selenium
API isElementPresented() call.

This is proved from the log and the following code snippet.

 Tellurium.prototype.locateElementWithCacheAware = function(locator,
inDocument, inWindow){
    var element = null;

    var json = locator;
    !tellurium.logManager.isUseLog || fbLog("JSON presentation of the cache
aware locator: ", json);
    var cal = JSON.parse(json, null);
    !tellurium.logManager.isUseLog || fbLog("Parsed cache aware locator: ",
cal);

    !tellurium.logManager.isUseLog || fbLog("Tellurium Cache option: ",
this.isUseCache());
    if (this.isUseCache()) {
        //if Cache is used, try to get the UI element from the cache first
        element = this.getUiElementFromCache(cal.rid);
        !tellurium.logManager.isUseLog || fbLog("Got UI element " + cal.rid
+ " from Cache.", element);

        if (element != null) {
            //need to validate the result from the cache
            !tellurium.logManager.isUseLog || fbLog("Trying to validate the
found UI element " + cal.rid, element);
            if (!validateDomRef(element)) {
                fbError("The UI element " + cal.rid + " from cache is not
valid", element);
                this.cache.relocateUiModule(cal.rid);
                //after relocating the UI module, retry to get the UI
element from the cache
                element = this.getUiElementFromCache(cal.rid);
                !tellurium.logManager.isUseLog || fbLog("After relocating UI
module, found ui element" + cal.rid, element);
            }
        }else{
            if(cal.locator != null && cal.locator.trim().length > 0){
                //If cannot find the UI element from the cache, locate it as
the last resort
                !tellurium.logManager.isUseLog || fbLog("Trying to locate
the UI element " + cal.rid + " with its locator " + cal.locator + " because
cannot find vaild one from cache", cal);
                element = this.locate(cal.locator);
            }
        }
    }else{
        !tellurium.logManager.isUseLog || fbLog("Trying to locate the UI
element " + cal.rid + " with its locator " + cal.locator + " because cache
option is off", cal);
        element = this.locate(cal.locator);
    }

    if(element == null){
        fbError("Cannot locate element for uid " + cal.rid + " with locator
" + cal.locator, element);
    }

    !tellurium.logManager.isUseLog || fbLog("Returning found UI element ",
element);
    return element;
};



On Mon, Mar 22, 2010 at 2:04 PM, dominicm <[email protected]>wrote:

>
>
> Apologies I hit return when i was still composing the message! To be
> more specific, this problem only happens if the element doesn't exist
> on the page.
>
> Not sure if this is a selenium bug or not, but what seems to be
> happening is that isElementPresent is getting stuck in an infinite
> loop, presumably because the returned value is null. Exact same tests
> are fine in FF and googlechrome. I'm using IE8.
>
> Here are snippets from the engine log.
>
> "Issue Bundle Command "
> "[{"uid":"mainColumn.pods.largePodContainer[1].events[1].eventName","args":
> ["jquery=#podsContainer div.Expander:not(.narrow):eq(0) div.podContent
> > table > tbody > tr:eq(0)
> td.eventName"],"name":"isElementPresent","sequ":8}]"
> "Dispatching command: " Object sequ=8
> uid="mainColumn.pods.largePodContainer[1 ..." name="isElementPresent"
> args=[1]
> "Update argument list for command isElementPresent" Object sequ=8
> uid="mainColumn.pods.largePodContainer[1 ..." name="isElementPresent"
> args=[1]
> "Command after updating argument list: " Object sequ=8
> uid="mainColumn.pods.largePodContainer[1 ..." name="isElementPresent"
> args=[1]
> "delegate command to Selenium" Object sequ=8
> uid="mainColumn.pods.largePodContainer[1 ..." name="isElementPresent"
> args=[1]
> "Delegate Call isElementPresent to Selenium" Object sequ=8
> uid="mainColumn.pods.largePodContainer[1 ..." name="isElementPresent"
> args=[1]
> "JSON presentation of the cache aware locator: "
>
> "{"rid":"mainColumn.pods.largePodContainer[1].events[1].eventName","locator":"jquery=#podsContainer
> div.Expander:not(.narrow):eq(0) div.podContent > table > tbody >
> tr:eq(0) td.eventName"}"
> "Parsed cache aware locator: " Object
> rid="mainColumn.pods.largePodContainer[1 ..."
> locator="jquery=#podsContainer div.Expander: ..."
> "Tellurium Cache option: " false
> "Trying to locate the UI element
> mainColumn.pods.largePodContainer[1].events[1].eventName with its
> locator jquery=#podsContainer div.Expander:not(.narrow):eq(0)
> div.podContent > table > tbody > tr:eq(0) td.eventName because cache
> option is off" Object rid="mainColumn.pods.largePodContainer[1 ..."
> locator="jquery=#podsContainer div.Expander: ..."
> >>> console.trace(stack)
> function"[object Object]"argumentsundefined
> function"[object Object]"argumentsundefined
> function"[object Object]"argumentsundefined
> "Cannot locate element for uid
> mainColumn.pods.largePodContainer[1].events[1].eventName with locator
> jquery=#podsContainer div.Expander:not(.narrow):eq(0) div.podContent >
> table > tbody > tr:eq(0) td.eventName" null
> "Returning found UI element " null
> "JSON presentation of the cache aware locator: "
>
> "{"rid":"mainColumn.pods.largePodContainer[1].events[1].eventName","locator":"jquery=#podsContainer
> div.Expander:not(.narrow):eq(0) div.podContent > table > tbody >
> tr:eq(0) td.eventName"}"
> "Parsed cache aware locator: " Object
> rid="mainColumn.pods.largePodContainer[1 ..."
> locator="jquery=#podsContainer div.Expander: ..."
> "Tellurium Cache option: " false
>
> <snip>
>
> "Trying to locate the UI element
> mainColumn.pods.largePodContainer[1].events[1].eventName with its
> locator jquery=#podsContainer div.Expander:not(.narrow):eq(0)
> div.podContent > table > tbody > tr:eq(0) td.eventName because cache
> option is off" Object rid="mainColumn.pods.largePodContainer[1 ..."
> locator="jquery=#podsContainer div.Expander: ..."
> >>> console.trace(stack)
> function"[object Object]"argumentsundefined
> function"[object Object]"argumentsundefined
> function"[object Object]"argumentsundefined
> "Cannot locate element for uid
> mainColumn.pods.largePodContainer[1].events[1].eventName with locator
> jquery=#podsContainer div.Expander:not(.narrow):eq(0) div.podContent >
> table > tbody > tr:eq(0) td.eventName" null
> "Returning found UI element " null
> "Issue Bundle Command " "[{"uid":"","args":
> [],"name":"isAlertPresent","sequ":9}]"
> "Dispatching command: " Object sequ=9 uid="" name="isAlertPresent"
> args=Object
> "Command after updating argument list: " Object sequ=9 uid=""
> name="isAlertPresent" args=Object
> "delegate command to Selenium" Object sequ=9 uid=""
> name="isAlertPresent" args=Object
> "Delegate Call isAlertPresent to Selenium" Object sequ=9 uid=""
> name="isAlertPresent" args=Object
>
> --
> 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]<tellurium-users%[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.

Reply via email to