Hi Jian,

I've had some time to look into these issues some more.

The good news
Issue 402 - isVisible - This now works for me if I add an extra check
for element.css("visibility"). I've updated the issue with a working
example


The not so good news
Issues 403 and 404, plus other issues I've found with mouseOver,
mouseOut and several other event related functions seem to stem from a
problem with using the jQuery event APIs. Basically I don't think many
of them work unless the event handlers have been defined using jQuery
itself.


Having said that I did find a way of getting both methods working,
though I think this may be a bit of a re-invention of the selenium
APIs for the most part.

For 403 I played around and found a way of triggering the event
handlers using logic like the following:

Selenium.prototype.doSelectByValueAlt = function(locator, value) {
        var element = selenium.browserbot.findElement(locator);
        teJQuery(element).val(value);
        if( teJQuery.browser.msie){
                element.fireEvent("onchange");
        } else {
                var evObj = document.createEvent('HTMLEvents');
                evObj.initEvent( 'change', true, true );
                element.dispatchEvent(evObj);
        }
}

For 404 using similar code works with links and popups just fine and
seems works better than the default selenium click for googlechrome
and safari.

Selenium.prototype.doClickJQ = function(locator) {
        var element = selenium.browserbot.findElement(locator);
        if(element.href || element.url){
                if( teJQuery.browser.msie){
                        element.fireEvent("onclick");
                } else {
                        //teJQuery(element).val(option)
                        var evObj = document.createEvent('HTMLEvents');
                        evObj.initEvent( 'click', true, true );
                        element.dispatchEvent(evObj);
                }
        } else {
                teJQuery(element).click();
        }
}





On Mar 9, 2:31 pm, John <[email protected]> wrote:
> The following issues are created for tracking purpose.
>
> http://code.google.com/p/aost/issues/detail?id=402http://code.google.com/p/aost/issues/detail?id=403http://code.google.com/p/aost/issues/detail?id=404
>
> Thanks,
>
> Jian
>
> On Mar 7, 4:39 pm, Jian Fang <[email protected]> wrote:
>
>
>
> > Dominic,
>
> > We really appreciate your feedback and will create couple issues to track
> > the problems
> > listed in your email.
>
> > Thanks,
>
> > Jian
>
> > On Sun, Mar 7, 2010 at 8:07 AM, dominicm <[email protected]> wrote:
> > > Hi,
>
> > > I've started using the new APIs and have come across a few issues.
>
> > > 1. isVisible does not return the correct value at all times.
> > > I think the function will need additional checks, maybe like:
>
> > > teJQuery(selenium.browserbot.findElement("jquery=#totalFunds")).css('visibi­lity')
>
> > > 2. selectByValue, selectByLabel etc. do not seem to trigger JavaScript
> > > events
> > > During my tests the field contents are modified but pages do not
> > > reload when I expect them to.
> > > I noticed the selenium API has this at the end of the code
> > > if (changed) { triggerEvent(element, 'change', true); }
> > > I tried doing a similar thing with jQuery but could not make it work.
>
> > > 3. click does not work correctly when a link should open a popup
> > > window. Instead it opens the location of the popup in the main window.
> > > Maybe some extra logic to take account of the "target" attribute is
> > > needed?
>
> > > Thanks
>
> > > --
> > > 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%2bunsubscr...@­googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/tellurium-users?hl=en.- Hide quoted text -
>
> - Show quoted text -

-- 
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