Closed
Bug 610676
Opened 14 years ago
Closed 9 years ago
Build from ad0a0be8be74 has broken Selenium .submit function
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: automatedtester, Unassigned)
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
In nightly from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2010/10/2010-10-14-03-mozilla-central/ the .submit(formElement) in Selenium started throwing errors when the command was executed. The error is [info] Executing: |submit | myForm | | [error] Unexpected Exception: QueryInterface -> function QueryInterface() { [native code] }, message -> Component is not available, result -> 2147746065, name -> NS_ERROR_NOT_AVAILABLE, filename -> chrome://selenium-ide/content/selenium/scripts/selenium-browserbot.js, lineNumber -> 1656, columnNumber -> 0, location -> JS frame :: chrome://selenium-ide/content/selenium/scripts/selenium-browserbot.js :: anonymous :: line 1656, inner -> null, data -> null, initialize -> function initialize() { [native code] } The lines that it is talking about is BrowserBot.prototype.submit = function(formElement) { var actuallySubmit = true; this._modifyElementTarget(formElement); if (formElement.onsubmit) { The formElement is created in Selenium by specifying the target in Selenium IDE which is attached. There is a test case attached for Selenium IDE that will recreate the issue.
Reporter | ||
Comment 1•14 years ago
|
||
Updated•14 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Comment 2•14 years ago
|
||
I took a guess about the component where this should go, at least to get it triaged.
Comment 3•14 years ago
|
||
Can you please post the pushlog with the changeset ids so we can see which check-ins happened during this day? Thanks.
Comment 4•14 years ago
|
||
Which of the lines in comment 0 is the exception being thrown on? And is this code running as chrome, or in a web page?
Reporter | ||
Comment 5•14 years ago
|
||
Pushlog is http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2593c8c8af8b&tochange=ad0a0be8be74 This is running in the chrome. The line that it throws the error on is if (formElement.onsubmit){
Updated•14 years ago
|
Keywords: regression,
regressionwindow-wanted
Comment 6•14 years ago
|
||
I will try to find the causing check-in by running a hg bisect through the day.
Comment 7•14 years ago
|
||
This should never have worked; see bug 607352. Why were you not getting an XPCNativeWrapper before but are getting one now? The relevant changeset will be something from the compartments landing; stuff inside there may or may not actually compile.
Reporter | ||
Comment 8•14 years ago
|
||
It appears as thought it is now returning a XPCNativeWrapper like mentioned by Boris in comment #7. Updating the Selenium code to BrowserBot.prototype.submit = function(formElement) { var actuallySubmit = true; if (formElement.wrappedJSObject){ formElement = formElement.wrappedJSObject; } this._modifyElementTarget(formElement); if (formElement.onsubmit) { doesn't throw the error any more.
Comment 9•14 years ago
|
||
OK, and it wasn't before? Where's formElement coming from? (As a note, the code in comment 8 is the wrong way to unwrap an XPCNativeWrapper, but let's not worry about that for now.)
Reporter | ||
Comment 10•14 years ago
|
||
so the testrunner calls in selenium-api.js Selenium.prototype.doSubmit = function(formLocator) { /** * Submit the specified form. This is particularly useful for forms without * submit buttons, e.g. single-input "Search" forms. * * @param formLocator an <a href="#locators">element locator</a> for the form you want to submit */ var form = this.browserbot.findElement(formLocator); return this.browserbot.submit(form); }; where form locator is xpath=//form in the test case. Then it calls the below code in selenium-browserbot.js BrowserBot.prototype.submit = function(formElement) { var actuallySubmit = true; if (formElement.wrappedJSObject){ formElement = formElement.wrappedJSObject; } this._modifyElementTarget(formElement); if (formElement.onsubmit) { ..... which then executes. This code is is viewable at http://code.google.com/p/selenium/source/browse/#svn/trunk/ide/src/extension/content
Comment 11•14 years ago
|
||
OK, what does that findElement function do? (I did search for it using your link, but there are tons of irrelevant hits.)
Reporter | ||
Comment 12•14 years ago
|
||
findElement is in selenium-browserbot.js. vim has it as line number 1416. Most of the Selenium core code is in this file
Comment 13•14 years ago
|
||
OK, that ends up indirecting through: var locatorFunction = this.locationStrategies[locatorType]; locatorFunction.call(this, locator, inDocument, inWindow) What does that actually call in this case?
Reporter | ||
Comment 14•14 years ago
|
||
in this case its going down to the xpath code /** * Finds an element identified by the xpath expression. Expressions _must_ * begin with "//". */ BrowserBot.prototype.locateElementByXPath = function(xpath, inDocument, inWindow) { return this.xpathEvaluator.selectSingleNode(inDocument, xpath, null, this._namespaceResolver); }; BrowserBot.prototype._namespaceResolver = function(prefix) { if (prefix == 'html' || prefix == 'xhtml' || prefix == 'x') { return 'http://www.w3.org/1999/xhtml'; } else if (prefix == 'mathml') { return 'http://www.w3.org/1998/Math/MathML'; } else { throw new Error("Unknown namespace: " + prefix + "."); } };
Comment 15•14 years ago
|
||
OK, which of the 4 different implementations of selectSingleNode (none of which take the namespace resolved as the 4th argument) is involved? But at this point, the only real options are either that we had a bug before and handed out something that wasn't XPCNativeWrapper when we shouldn't have or that something weird is going on...
Comment 16•14 years ago
|
||
(In reply to comment #5) > http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2593c8c8af8b&tochange=ad0a0be8be74 I should have been checked that before I have started the bisect this morning. As it turns out this range is not correct for my self-made opt build. I will continue tomorrow.
Comment 17•14 years ago
|
||
For me this failure appeared the first time with the 10071603 build. So one of the following changes has been caused it on my box: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5fda39cd703c&tochange=96de199027d7
Comment 18•14 years ago
|
||
That's a lot less believable than the first regression range; nothing in this new range looks relevant.
Comment 19•14 years ago
|
||
So I did a bisect given my pushlog from above and I can clearly reproduce it with the revision below. Everything is fine without this patch. The first bad revision is: changeset: 47784:aba8cc27fcef parent: 47782:b141a304ad08 parent: 47783:d4aafb90ff96 user: Jim Mathies <jmathies@mozilla.com> date: Thu Jul 15 21:47:52 2010 -0500 summary: merge This merge is related to: http://hg.mozilla.org/mozilla-central/rev/d4aafb90ff96 Jim Mathies — Backing out 'Call Show if our nsIXULWindow will not' patch from bug 574690 due to various regressions. r=bz
Reporter | ||
Comment 20•14 years ago
|
||
Made a minor adjustment to the test case to help
Attachment #489178 -
Attachment is obsolete: true
Comment 21•14 years ago
|
||
David, were you able to get closer to the new range you have mentioned on IRC last Friday?
Reporter | ||
Comment 22•14 years ago
|
||
I think that I was doing something wrong because I was able to replicate the issue in the clean profile using the add-on going back into the June nightlies however if I use Firefox 4b6 build 2 using Selenium RC I don't get an error. If I use Firefox 4b7 build 1 I get the error. from selenium import selenium sel = selenium('localhost', 4444, '*firefox', 'http://crash-stats.stage.mozilla.com') sel.start() sel.open('/') sel.submit('//form')
Reporter | ||
Comment 23•14 years ago
|
||
Selenium RC can be downloaded from http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.0a7.jar
Comment 24•14 years ago
|
||
I wonder if we should stick by the extension first and not jump between both ways of running tests.
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Reporter | ||
Comment 26•9 years ago
|
||
that API is now deprecated in selenium so closing
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(dburns)
Resolution: --- → WONTFIX
Updated•9 years ago
|
Keywords: regressionwindow-wanted
You need to log in
before you can comment on or make changes to this bug.
Description
•