Search Results

Search found 2 results on 1 pages for 'tohop'.

Page 1/1 | 1 

  • Selenium onChange not working

    - by tohop
    Hi, I have tried a number of things to try and get Selenium to pick up an 'onchange' event from a drop down menu, none of which has worked. The offending HTML is: <select onchange="doOpperation(this.options[this.selectedIndex]); this.selectedIndex = 0;" name="opps_ondemand" id="opps_ondemand"> <option value="none" id="ondemand">Mark as...</option> <option cmd="blah1" value="add">Something</option> <option cmd="blah2" value="remove">None</option> </select> I have read that Selenium IDE doesn't record some on* events, and so it would be wise to use fireEvent(): $this->click("opps_ondemand"); $this->select("opps_ondemand", "label=Mark as..."); $this->click("//option[@value='add']"); sleep(3); $this->fireEvent("//select[@id='opps_ondemand']", "change"); However, this does not work (with or without the fireEvent). I have also tried using $this->fireEvent("locator", "click"); instead of $this->click("locator"); but this did nothing. Selenium does not complain about these locators not existing so I am assuming it can see the select/option elements fine. The problem seems to be the onChange event. Does anyone know how to resolve this? Thanks.

    Read the article

  • jQuery validate problem

    - by tohop
    Hi there. I have a jquery dialog box that pops up and takes user data through a form. Once the user is finished s/he clicks the 'ok' button. This dialog box has a few 'tabs' such that when 'ok' is clicked, we want to validate all the data given in each tab. If anything is invalid, we take the user to that tab and tell them what's wrong. However, it takes 2 clicks of 'ok' to achieve this. Here is the offending jquery: if(errors){ // display the tab with the error jQuery('#recording_tabs > div').each( function(i){ alert('we are here'); if(jQuery(this).find('*').not('label').hasClass('invalid')){ jQuery('#recording_tabs').tabs('option','selected', i); return false;// prevent further processing } }); } So what happens in the above code is that when we click 'ok' we get a 'we are here' alert for each div (tab) and then nothing happens. Clicking 'ok' again gives us the 'we are here' alert up until we are taken to the tab with the errors. So obviously the first time round the inner if statement is false for each tab which probably means jQuery hasn't registered the 'invalid' classes in time. So I tried a blank each() statement just before the main one in the hope that it would fix the problem jQuery('#recording_tabs > div').each( function(i){} ); But I got the same result. Can anyone spot anything I am missing?

    Read the article

1