Mendix has problems with Selenium IDE input.

1
[EDIT] To clear things up. Manually it works. Selenium does change the numbers in the number fields. It's only when the save/action button is pressed that the POST change request does not include number field changes, thus the 'form' is submitted, with text/date changes, but the numbers remain uncommited. [/EDIT] When I run a Selenium IDE test case, everything goes fine except for filling out form that requires input number fields. For some reason those changes are not added to the JSON object's parameters, while others do.
asked
3 answers
1

If you're simply looking for the command to fill a number field using Selenium then a simple 'set' command on the element ".mx-name-<name-attribute> input" should work. The name attribute can be found (and configured) under the 'Name' setting of your textbox in the modeler.

answered
1

I know my reply comes late, but did you try (Using the example you've posted a while ago):

fireEvent|css=#mxuiwidgetNumberInput5input|blur

Especially form pages with a lot of input fields require fireEvents to 'commit' the values in the inputfields. (selectors, bullets, dropdowns, multiselects etc) Normally keystrokes fill the values, but type only 'paste' the values. That's why you have to manually 'force' the event by using fireEvent and blur.

I hope this will help others who experience the same problems.

answered
0

Selenium 3.0 doesn't have the fireEvent command. I added the following 'execute script'** command at the end of my form to trigger an onchange event before submitting. 

(function() {
    var inputs = document.getElementsByTagName('input');
    var event = new Event('change');
    for(var i=0;i<inputs.length;i++) {
        var input = inputs[i];
        input.dispatchEvent(event);
    }
})();

** the script must be added as target, the value is empty 

 

answered