selenium.WebDriverException throw failure code 0x80004005 when using a withFrame() method in Firefox

0

I am creating a test suite for a web site (implemented using node and Angular) that gathers user input. Some of the input is in the form of text box with editing capabilities (similar to this one used in stack overflow). The code that creates the editable box is

<div id="mceu_30" class="mce-edit-area mce-container mce-panel mce-stack-layout-item" hidefocus="1" tabindex="-1" role="group" style="border-width: 1px 0px 0px;"> 

<iframe id="ui-tinymce-9_ifr" frameborder="0" allowtransparency="true" title="Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help" style="width: 100%; height: 100px; display: block;"></iframe>

<html> <head><style>...</style></head> <body id="tinymce" class="mce-content-body " data-id="ui-tinymce-1" contenteditable="true" spellcheck="false"><p><br data-mce-bogus="1"></p></body> </html>

</div>

For simplicity I have removed all the section.

I am using Geb/Spock framework for test. The specific piece of code that checks the above element is

 withFrame(OppBackgroundBox){$("body", id:"tinymce") << Background }

Where 'Background' is a string defined previously in the test script, and OppBackgroundBox is a page element defined as

  OppBackgroundBox{$(By.xpath('//iframe[@title="Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"]'),0)}

I identify the element by the title because the id of the frame changes with the browser (//[@id="ui-tinymce-9_ifr"] for Mozilla, but //[@id="ui-tinymce-1_ifr" for Chrome).

All works fine and well when running the test in Chrome, however, when using Firefox (65.0.1 for Mac) I get the following error

Condition failed with Exception:

withFrame(OppBackgroundBox){$("body", id:"tinymce") << Background } | | | pages.app.OpportunitiesAdminCreatePage -> OppBackgroundBox: geb.navigator.NonEmptyNavigator

org.openqa.selenium.WebDriverException: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITextInputProcessor.beginInputTransactionForTests]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://marionette/content/event.js :: getTIP_ :: line 429" data: no] Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Carless-MacBook-Pro.local', ip: 'fe80:0:0:0:c3c:ed6e:6d05:b45d%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '11.0.1' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 65.0.1, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.24.0, moz:headless: false, moz:processID: 30057, moz:profile: /var/folders/10/vbth59yn0v1..., moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: MAC, platformName: MAC, platformVersion: 18.2.0, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: 62b25df0-58cf-db4f-9d3c-12a1b12820ce

at CreateProgramProjectOpp.Publish Opportunity: '#TitleData'(CreateProgramProjectOpp.groovy:195)

(where 195 refers to the withFrame(OppBackgroundBox){$("body", id:"tinymce") << Background } line of code)

The error message above is a bit garbled, but associated to OppBackgroundBox is the message

pages.app.OpportunitiesAdminCreatePage -> OppBackgroundBox: geb.navigator.NonEmptyNavigator

So the problem is not about WebDriver being unable to locate the element.

The version of the different components appear in the error message. The Gecko driver version is 0.24.0

At this moment I do not know if this is a problem with WebDriver, Geb or some configuration/versioning error on my part.

Has anybody found this problem and a workaround? Thanks in advance for any help.

webdriver
geckodriver
geb
selenium-firefoxdriver

1 Answer

0

This is a problem with your Firefox setup and does not have anything to do with Geb. The underlying error from the browser is:

Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsITextInputProcessor.beginInputTransactionForTests]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://marionette/content/event.js :: getTIP_ :: line 429" data: no

I would suggest googling for parts of the error and seeing what this gives you. It will most likely be something to do with your Firefox state or an incompatibility between the version of FF and the version of Gecko driver binary you're using.

answered on Stack Overflow Feb 21, 2019 by erdi

User contributions licensed under CC BY-SA 3.0