Edge Webdriver (15.15063) underlying webdriver instance does not support javascript (Selenium::WebDriver::Error::UnsupportedOperationError) - when using execute_script

Issue #13599112 • Assigned to Steven K.

Details

Author
Mark D.
Created
Sep 6, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
15.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

My test setup

  • Edge 15.15063
  • Webdriver is matching the Edge version
  • Selenium-Standalone-Server (tested with 3.5.0 and 3.5.3)
  • ruby version 2.3.3 (32bit)
  • lapis_lazuli gem version 2.0.0
  • watir gem version 6.7.1
  • selenium-webdriver version 3.5.1

Issue

When I perform a fire_event actions, I get an error like this:

irb(main):018:0> browser.wait(:like => [:div, :class, 'menuexpander']).fire_event("click")
Selenium::WebDriver::Error::UnsupportedOperationError: underlying webdriver instance does not support javascript
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/oss/bridge.rb:569:in `assert_javascript_enabled'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/oss/bridge.rb:267:in `execute_script'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/common/driver.rb:213:in `execute_script'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.7.1/lib/watir/atoms.rb:18:in `execute_atom'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.7.1/lib/watir/elements/element.rb:352:in `block in fire_event'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.7.1/lib/watir/elements/element.rb:745:in `element_call'
    from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.7.1/lib/watir/elements/element.rb:352:in `fire_event'
    from (irb):18
    from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):019:0>

On Chrome and Firefox I don’t have this issue. See attached screenshot for the message during a test run.

Additional info

selenium-grid node config

{
 "capabilities": [
   {
     "browserName": "MicrosoftEdge",
     "platform": "WIN10",
     "javascript_enabled": true,
     "seleniumProtocol": "WebDriver",
     "maxInstances": 1
   }    
 ],
 "hub": "http://localhost:4444",
 "port": 5555,
 "maxSession": 1
}

The grid-console does see this config (see attached screenshot grid-console.PNG)

my env.rb file

if ENV['BROWSER'] == 'win10edge'
 browser :remote, {
  :url => "http://localhost:4444/wd/hub",
  :caps => {
        "browserName" => "MicrosoftEdge",
         "javascript_enabled" => true,
    }
 }  

Which is described in the lapis_lazuli gem documentation here (in the remote testing section): https://github.com/spriteCloud/lapis-lazuli/wiki/Browser-Basics)
And also here: https://github.com/SeleniumHQ/selenium/blob/7e8f5f1e8ee8965e0d54a51767de1d766570de1a/rb/lib/selenium/webdriver/remote/capabilities.rb#L74

Maybe I’m just doing something wrong with starting the selenium-grid node for Edge, but I cannot find any clear information how to do this.
The only clear post I found was this non MS page: http://morgwai.pl/articles/selenium-edge.html
(Of course I also tried it without the javascript_enabled capability as mentioned in that post, but the result is the same. FF and Chrome work, Edge gives me the javascript error.

Side note

It all seems to work when I use Selenium-Standalone-Server 3.4.0 and the ruby gem selenium-webdriver version 3.4.0
I’m not yet sure if this means there is an issue in selenium or in edgewebdriver, but I hope it can be fixed since selenium-webdriver 3.5.0 is executing the tests way faster (twice as fast in my case, so I don;t want to use the old ones)

Attachments

Comments and activity

  • If I want to perform an action like element.flash I get the same kind of error.

    irb(main):018:0> element = browser.wait(:like => [:input, :name, 'username'])
    => #"//input[contains(concat('', normalize-space(@name), ''), 'username')]", :tag_name=>"input", :index=>0}>
    irb(main):019:0> element.flash
    Selenium::WebDriver::Error::UnsupportedOperationError: underlying webdriver instance does not support javascript
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/oss/bridge.rb:569:in `assert_javascript_enabled'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/oss/bridge.rb:267:in `execute_script'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/common/driver.rb:213:in `execute_script'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.7.1/lib/watir/elements/element.rb:233:in `flash'
        from (irb):19
        from C:/Ruby23/bin/irb.cmd:19:in `'
    irb(main):020:0>
    

    http://www.testautomation.info/Lapis_Lazuli:Interacting_with_an_element
    Since the lapis_lazuli gem is just an extension of Watir, I thought it might be handy to also mention the following

    • For lapis_lazuli 1.1.0, selenium-webdriver 3.4.0 I used watir 6.2.1
    • For lapis_lazuli 2.0.0, selenium-webdriver 3.5.1 I used watir 6.7.1
  • I also posted a question in the Watir group, in case this is not Edge Webdriver related but Watir related. See >> https://groups.google.com/forum/#!topic/watir-general/KRehp-T0V-8

  • From the Watir team I’ve learned that Edge uses a weird combination of oss and w3c protocols. The issue is in selenium so I’ll create a ticket there. I’ll also post here when a cause/solution is known for this issue.

  • Here is the selenium ticket for referrence https://github.com/SeleniumHQ/selenium/issues/4651

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

  • Thank you for the update.  I agree that this looks like a selenium-standalone-server issue.  Mainly because the same test is working in selenium 3.4.0.  Also, the other difference between the working and non-working environment is a different watir version right?

    Keep us updated and I will let you know if I find out anything on my end.

    Appreciate the support,

    Steve

  • Microsoft Edge Team

    Changed Status to “Not reproducible”

  • I verified that our MicrosoftWebDriver does work and has been tested with Selenium Standalone Server 3.5.3 using the .Net language bindings.

    I am closing this as 'no repro’, however, re-open the ticket if you believe it is a MicrosoftWebDriver issue.

    Appreciate the support,

    The MS Edge Team

  • Changed Status from “Not reproducible”

  • Hi Steven K.
    It’s nice that it works with .Net bindings), but .Net was not mentioned in my test setup or reproduce steps, so before labaling it as "cannot reproduce", could you also give it a try with Ruby bindings? Because that would be in line with what I reported.

    In the meantime the Selenium team came up with this fix
    https://github.com/SeleniumHQ/selenium/commit/00ca43f153137bb0b37543fe117d4857d87ba576
    Once the new build is ready, I’ll give it another try with Ruby bindings.
    Cheers,
    Mark D.

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

  • Hi Mark,

    Sorry about that.  I should have said I was going to close the ticket as "working as designed".  Not, no repro.  It is repro.  There is an issue, however, it appeared to be with the Ruby language bindings or perhaps the Selenium server and not with Edge.  I only mentioned the .Net bindings because they were used to verify WebDriver functionality with that Selenium Server version.  E.g. pointing to the Ruby language bindings.

    Yes, I can leave this open for a bit and see about verifying the issue is resolved by the default change.  It sounds like having the Ruby language binding code explicitly set javascript to enabled will solve this issue.  It fits all the “clues” we had. :)

    Steve

You need to sign in to your Microsoft account to add a comment.

Sign in