Rectangle 27 0

Whipped this together real quick. This has a variable which will hold all the data for each form, by name, and the last time focused. It uses that last time focused to calculate the amount of time it was in focus, on blur.

var Status = {};

var focusHandler = function() {
    var name = this.name;
    console.log("Focus", name, Status[name]);
    if (!Status[name]) Status[name] = {
        total: 0,
        focus: Date.now()
    }
    else Status[name].focus = Date.now();
}
var blurHandler = function() {
    var name = this.name;
    if (Status[name]) {
        Status[name].total += Date.now() - Status[name].focus;
    }
}

// You don't have to attach them this way, it's just for example

var inputs = document.getElementsByTagName('input');

for (var i = 0, l = inputs.length; i < l; i++) {
    inputs[i].onfocus = focusHandler;
    inputs[i].onblur = blurHandler;
}

javascript - How to monitor time it takes a user to enter data into a ...

javascript html
Rectangle 27 0

This bug is very annoying, even worse there was very few informations we could find on google.

There is only one link from Microsoft that about IE9, but problem still exists in IE10 / IE11 and much easier to reproduce.

I have just create a fiddle to describe this problem

there should be three workarounds

  • Reset the focus every time we modify the DOM with iframe

or schedule a "do nothing" time consuming task, which may make IE response to mouse event magically, I could not tell you why, maybe M$ could

The sample codes which setup a time consuming task

setInterval(function () {
    var loopCount = 10000;
    var x = 0;
    for (var i = 0; i < loopCount; i++) {
        x = (x + Math.random() * 1000) >>> 0;
    }
    return x;
}, 1000);

or reset the DOM content before remove it from document

someDivWithIframe.innerHTML = "";
$(someDivWithIframe).remove();

I am not sure if it helps for all cases, you should have a tried

javascript - IE 9 and IE 10 cannot enter text into input text boxes fr...

javascript html internet-explorer internet-explorer-9 internet-explorer-10
Rectangle 27 0

I have managed to fix this bug by setting focus back to the main page. What I have done so far is: put an HTML input textbox, which is set invisible, in the main page. When the iframe closes, I set focus back to that textbox.

Please refer following links for more information about this IE bug.

javascript - IE 9 and IE 10 cannot enter text into input text boxes fr...

javascript html internet-explorer internet-explorer-9 internet-explorer-10
Rectangle 27 0

I was also suffering from this issue. As William Leung has pointed, IE has a bug with remove Iframe Object from DOM.

$(someDivWithIframe).empty().remove();

javascript - IE 9 and IE 10 cannot enter text into input text boxes fr...

javascript html internet-explorer internet-explorer-9 internet-explorer-10
Rectangle 27 0

The solution with jQuery worked on IE11 for me, not the other solutions.

$(theIframeElement).empty().remove();

An other solution working on IE9/10 was to set the iframe src to empty before deleting it

iframe.src=""

But this cause an exception "Access denied" on IE11 if you are using an older jQuery version < 1.11.1

Some links: For information, jQuery also fixed this Issue for it's Dialog.js plugin that was displaying content in an iframe: http://bugs.jqueryui.com/ticket/9122

Oh sorry, i make a mistake, the focus problem just come back on my IE11 !!! i want to cry ! so no solution for the moment for IE11

I was doing a window.focus() after removing the iframe. removing the window.focus() seam to make the bug disappear on IE11, but some time (randomly) THE BUG come back on IE11

javascript - IE 9 and IE 10 cannot enter text into input text boxes fr...

javascript html internet-explorer internet-explorer-9 internet-explorer-10
Rectangle 27 0

Creating good automated GUI tests is a significant time investment. While some automated testing tools allow you to create tests from screen recording, the best tests are performed using scripting so that you can generalize behavior. ie.. wait until dialog box X, appears, enter Y, on success do Z. TestComplete allows you to create robust tests using multiple scripting languages including javascript, with many many hooks to value added components, ie.. the ability to pull test input from the DB (data driven testing), comparison of gold master images against target, OCR to interpret dialog box text when in graphics form. Compared to other commercial offers its reasonably priced.

I love open sources as much as the next guy. But we chose TestComplete as well as we couldn't find a reasonable open-source alternative. If you are serious about automated testing then you will end up creating thousands of lines of reusable and robust test code that should add enough value to justify the cost.

Also TestComplete was recommended by the guys that made the site you are now using Joel on Software blog and is the winner of multiple Jolt awards TestComplete jolt awards

Also as a QTP user you may find this discussion on TestComplete vs QuickTestPro interesting. I don't want to come off sounding like an advocate for this product. But I have used this for years in several different operations all successfully, and recommend this to every software house I know. Unless you can find an open-source application that is equal or better I would recommend you go with this product and spend the money, as it will save you money.

Note that this recommendation is focused on Windows desktop applications. For Java based applications you may have some reasonable open-source alternatives: Open Source Automated Test Tools Written in Java

Automation testing tool for Regression testing of desktop application ...

automation regression
Rectangle 27 0

I originally wrote the plugin below to address memory leaks in IE 8, but consequently it also fixes this problem.

javascript - IE 9 and IE 10 cannot enter text into input text boxes fr...

javascript html internet-explorer internet-explorer-9 internet-explorer-10