montagejs / screening

49 stars 16 forks source link

Screening does not work in Chrome Dev Channel #254

Closed zacharyc closed 12 years ago

zacharyc commented 12 years ago

In Chrome Dev Channel, I ran into an issue whereby it screening was unable to find the interaction window. I reverted back to stable and was able to get the test working. This test was braking in screening on chrome dev channel


// ==== Start Recorded Script, Wed Apr 18 2012 13:39:56 GMT-0700 (PDT)==== 

var agent = new Agent();

agent.gotoUrl("/screening/samples/sample.html");

agent.setWindowSize(927, 1058);

agent.mouseMove([{"x":774,"y":915,"duration":0},{"x":784,"y":847,"duration":67},{"x":777,"y":521,"duration":49},{"x":765,"y":334,"duration":34},{"x":751,"y":241,"duration":17},{"x":715,"y":152,"duration":33},{"x":648,"y":79,"duration":34},{"x":621,"y":63,"duration":17},{"x":575,"y":52,"duration":82},{"x":551,"y":75,"duration":122},{"x":542,"y":104,"duration":245}]);
agent.element("/HTML/BODY/FORM/DIV[1]").click(Mouse.LEFT,329,4);
agent.mouseMove([{"x":542,"y":105,"duration":0},{"x":546,"y":119,"duration":183}]);
agent.element("//*[@id='textField']").click(Mouse.LEFT,208,14);
agent.mouseMove([{"x":547,"y":119,"duration":0},{"x":748,"y":151,"duration":267}]);
agent.element("//*[@id='textField']")
    .sendKeys("this is some text");

assertEquals("this is some text", agent.element("//*[@id='textField']").getText())
// ==== End Recorded Script ====
irinamok commented 12 years ago

Zack, is this still reproducible? Is it a bug in chrome?

zacharyc commented 12 years ago

It is still reproducible. Think it is a bug in chrome, but would need to spend more time investigating.

zacharyc commented 12 years ago

This problem happened because chrome started treating "newtab" as a domain, with it's own domain restrictions. When we try to launch an application in the child window, we load a different domain, thus losing the ability to control the window. The problem was solved by simply loading the application URL in the base window. It's not elegant (we have two windows with the app now), but it works.