Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME when rendering jstree with with capybara and headless...

Multi tool use
Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug:
There are dependencies in the Gemfile:
# Gemfile
gem 'capybara', '2.18.0'
gem 'selenium-webdriver', '3.141.0'
It is the simple page which renders jstree:
# jstree.html
<!doctype html>
<html>
<head>
<script src="https://rawgit.com/jquery/jquery/1.12.4/dist/jquery.min.js"></script>
<script src="https://rawgit.com/vakata/jstree/3.3.7/dist/jstree.min.js"></script>
<link href="https://rawgit.com/vakata/jstree/3.3.7/dist/themes/default/style.min.css" rel="stylesheet"/>
</head>
<body>
<h1>This is a list:</h1>
<ul id="tree"></ul>
<script>
$('#tree').jstree({
core: {
data: [{ "id": 1, "state": {}, "text": "Example", "parent": "#" }]
}
});
</script>
</body>
</html>
There is a ruby script to open the page with Capybara and save page screenshot:
# script.rb
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new(
args: %w[headless no-sandbox disable-dev-shm-usage window-size=1280,800])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.default_driver = :chrome
Capybara.app = Rack::File.new File.expand_path('../', __FILE__)
include Capybara::DSL
visit '/jstree.html'
page.save_and_open_screenshot
When I run bundle exec ruby script.rb
and then open the screenshot I see the following:
but when I open jstree.html in my chrome browser I see normal tree:
When I add output browser console messages to the end of the script
puts page.driver.browser.manage.logs.get(type)
and rerun bundle exec ruby script.rb
I get
SEVERE 2018-12-27 16:24:23 +0300: blob:http://127.0.0.1:49346/26695642-8b26-494b-a142-54a515db6512 - Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I am using chrome v71
and chromedriver v2.45
Does anybody have any idea what is going on there?
How can I fix this issue?
selenium-webdriver capybara jstree google-chrome-headless
add a comment |
Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug:
There are dependencies in the Gemfile:
# Gemfile
gem 'capybara', '2.18.0'
gem 'selenium-webdriver', '3.141.0'
It is the simple page which renders jstree:
# jstree.html
<!doctype html>
<html>
<head>
<script src="https://rawgit.com/jquery/jquery/1.12.4/dist/jquery.min.js"></script>
<script src="https://rawgit.com/vakata/jstree/3.3.7/dist/jstree.min.js"></script>
<link href="https://rawgit.com/vakata/jstree/3.3.7/dist/themes/default/style.min.css" rel="stylesheet"/>
</head>
<body>
<h1>This is a list:</h1>
<ul id="tree"></ul>
<script>
$('#tree').jstree({
core: {
data: [{ "id": 1, "state": {}, "text": "Example", "parent": "#" }]
}
});
</script>
</body>
</html>
There is a ruby script to open the page with Capybara and save page screenshot:
# script.rb
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new(
args: %w[headless no-sandbox disable-dev-shm-usage window-size=1280,800])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.default_driver = :chrome
Capybara.app = Rack::File.new File.expand_path('../', __FILE__)
include Capybara::DSL
visit '/jstree.html'
page.save_and_open_screenshot
When I run bundle exec ruby script.rb
and then open the screenshot I see the following:
but when I open jstree.html in my chrome browser I see normal tree:
When I add output browser console messages to the end of the script
puts page.driver.browser.manage.logs.get(type)
and rerun bundle exec ruby script.rb
I get
SEVERE 2018-12-27 16:24:23 +0300: blob:http://127.0.0.1:49346/26695642-8b26-494b-a142-54a515db6512 - Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I am using chrome v71
and chromedriver v2.45
Does anybody have any idea what is going on there?
How can I fix this issue?
selenium-webdriver capybara jstree google-chrome-headless
add a comment |
Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug:
There are dependencies in the Gemfile:
# Gemfile
gem 'capybara', '2.18.0'
gem 'selenium-webdriver', '3.141.0'
It is the simple page which renders jstree:
# jstree.html
<!doctype html>
<html>
<head>
<script src="https://rawgit.com/jquery/jquery/1.12.4/dist/jquery.min.js"></script>
<script src="https://rawgit.com/vakata/jstree/3.3.7/dist/jstree.min.js"></script>
<link href="https://rawgit.com/vakata/jstree/3.3.7/dist/themes/default/style.min.css" rel="stylesheet"/>
</head>
<body>
<h1>This is a list:</h1>
<ul id="tree"></ul>
<script>
$('#tree').jstree({
core: {
data: [{ "id": 1, "state": {}, "text": "Example", "parent": "#" }]
}
});
</script>
</body>
</html>
There is a ruby script to open the page with Capybara and save page screenshot:
# script.rb
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new(
args: %w[headless no-sandbox disable-dev-shm-usage window-size=1280,800])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.default_driver = :chrome
Capybara.app = Rack::File.new File.expand_path('../', __FILE__)
include Capybara::DSL
visit '/jstree.html'
page.save_and_open_screenshot
When I run bundle exec ruby script.rb
and then open the screenshot I see the following:
but when I open jstree.html in my chrome browser I see normal tree:
When I add output browser console messages to the end of the script
puts page.driver.browser.manage.logs.get(type)
and rerun bundle exec ruby script.rb
I get
SEVERE 2018-12-27 16:24:23 +0300: blob:http://127.0.0.1:49346/26695642-8b26-494b-a142-54a515db6512 - Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I am using chrome v71
and chromedriver v2.45
Does anybody have any idea what is going on there?
How can I fix this issue?
selenium-webdriver capybara jstree google-chrome-headless
Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug:
There are dependencies in the Gemfile:
# Gemfile
gem 'capybara', '2.18.0'
gem 'selenium-webdriver', '3.141.0'
It is the simple page which renders jstree:
# jstree.html
<!doctype html>
<html>
<head>
<script src="https://rawgit.com/jquery/jquery/1.12.4/dist/jquery.min.js"></script>
<script src="https://rawgit.com/vakata/jstree/3.3.7/dist/jstree.min.js"></script>
<link href="https://rawgit.com/vakata/jstree/3.3.7/dist/themes/default/style.min.css" rel="stylesheet"/>
</head>
<body>
<h1>This is a list:</h1>
<ul id="tree"></ul>
<script>
$('#tree').jstree({
core: {
data: [{ "id": 1, "state": {}, "text": "Example", "parent": "#" }]
}
});
</script>
</body>
</html>
There is a ruby script to open the page with Capybara and save page screenshot:
# script.rb
require 'capybara'
require 'selenium-webdriver'
Capybara.register_driver :chrome do |app|
options = ::Selenium::WebDriver::Chrome::Options.new(
args: %w[headless no-sandbox disable-dev-shm-usage window-size=1280,800])
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end
Capybara.default_driver = :chrome
Capybara.app = Rack::File.new File.expand_path('../', __FILE__)
include Capybara::DSL
visit '/jstree.html'
page.save_and_open_screenshot
When I run bundle exec ruby script.rb
and then open the screenshot I see the following:
but when I open jstree.html in my chrome browser I see normal tree:
When I add output browser console messages to the end of the script
puts page.driver.browser.manage.logs.get(type)
and rerun bundle exec ruby script.rb
I get
SEVERE 2018-12-27 16:24:23 +0300: blob:http://127.0.0.1:49346/26695642-8b26-494b-a142-54a515db6512 - Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
I am using chrome v71
and chromedriver v2.45
Does anybody have any idea what is going on there?
How can I fix this issue?
selenium-webdriver capybara jstree google-chrome-headless
selenium-webdriver capybara jstree google-chrome-headless
edited 2 days ago
asked Dec 27 at 13:26
Hirurg103
961715
961715
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Unfortunately Chrome 71 broke blob
URLs in headless mode. If you run against the Chrome 72 beta it should be fixed. You can see a discussion in a puppeteer issue - https://github.com/GoogleChrome/puppeteer/issues/3463
Also note you don't need to use the capybara-screenshot gem to take that screenshot - just call page.save_and_open_screenshot
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome tov72
locally and replacedapt-get install -y google-chrome-stable
withapt-get install -y google-chrome-beta
on CI the error has gone
– Hirurg103
2 days ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945865%2ffailed-to-load-resource-neterr-unknown-url-scheme-when-rendering-jstree-with%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Unfortunately Chrome 71 broke blob
URLs in headless mode. If you run against the Chrome 72 beta it should be fixed. You can see a discussion in a puppeteer issue - https://github.com/GoogleChrome/puppeteer/issues/3463
Also note you don't need to use the capybara-screenshot gem to take that screenshot - just call page.save_and_open_screenshot
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome tov72
locally and replacedapt-get install -y google-chrome-stable
withapt-get install -y google-chrome-beta
on CI the error has gone
– Hirurg103
2 days ago
add a comment |
Unfortunately Chrome 71 broke blob
URLs in headless mode. If you run against the Chrome 72 beta it should be fixed. You can see a discussion in a puppeteer issue - https://github.com/GoogleChrome/puppeteer/issues/3463
Also note you don't need to use the capybara-screenshot gem to take that screenshot - just call page.save_and_open_screenshot
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome tov72
locally and replacedapt-get install -y google-chrome-stable
withapt-get install -y google-chrome-beta
on CI the error has gone
– Hirurg103
2 days ago
add a comment |
Unfortunately Chrome 71 broke blob
URLs in headless mode. If you run against the Chrome 72 beta it should be fixed. You can see a discussion in a puppeteer issue - https://github.com/GoogleChrome/puppeteer/issues/3463
Also note you don't need to use the capybara-screenshot gem to take that screenshot - just call page.save_and_open_screenshot
Unfortunately Chrome 71 broke blob
URLs in headless mode. If you run against the Chrome 72 beta it should be fixed. You can see a discussion in a puppeteer issue - https://github.com/GoogleChrome/puppeteer/issues/3463
Also note you don't need to use the capybara-screenshot gem to take that screenshot - just call page.save_and_open_screenshot
edited Dec 27 at 19:13
answered Dec 27 at 19:01
Thomas Walpole
30k32647
30k32647
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome tov72
locally and replacedapt-get install -y google-chrome-stable
withapt-get install -y google-chrome-beta
on CI the error has gone
– Hirurg103
2 days ago
add a comment |
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome tov72
locally and replacedapt-get install -y google-chrome-stable
withapt-get install -y google-chrome-beta
on CI the error has gone
– Hirurg103
2 days ago
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome to
v72
locally and replaced apt-get install -y google-chrome-stable
with apt-get install -y google-chrome-beta
on CI the error has gone– Hirurg103
2 days ago
Thank you for the quick reply, Thomas! I found that Github issue also. After I upgraded Chrome to
v72
locally and replaced apt-get install -y google-chrome-stable
with apt-get install -y google-chrome-beta
on CI the error has gone– Hirurg103
2 days ago
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945865%2ffailed-to-load-resource-neterr-unknown-url-scheme-when-rendering-jstree-with%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
QGht,s3 fLbfP9 g2 Q vG,1Q7m1TR,fl,xQt49Ywqw7NIMaDnVaIyJdruDOdRasfz,q,w,E,u2mVu7EzfYdGJCUAaeQDDDCtOG728uajvSK