Skip to content

Instantly share code, notes, and snippets.

@aaltat
Created October 31, 2018 19:12
Show Gist options
  • Save aaltat/d3280f053072725290787408a6a3f612 to your computer and use it in GitHub Desktop.
Save aaltat/d3280f053072725290787408a6a3f612 to your computer and use it in GitHub Desktop.
Firefox element screenshot problem
1540935303315 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.Cn8nN09Ixa9U"
(firefox:14143): Gtk-WARNING **: 23:35:04.189: Theme parsing error: <data>:1:34: Expected ')' in color definition
(firefox:14143): Gtk-WARNING **: 23:35:04.189: Theme parsing error: <data>:1:77: Expected ')' in color definition
1540935306051 Marionette INFO Listening on port 36581
1540935306099 Marionette WARN TLS certificate errors will be ignored for this session
1540935306428 Marionette INFO Stopped listening on port 36581
JavaScript error: resource://activity-stream/lib/TopSitesFeed.jsm, line 86: TypeError: setting getter-only property "_currentSearchHostname"
1541012371437 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.Vny9Bp9ej1vg"
(firefox:3028): Gtk-WARNING **: 20:59:32.381: Theme parsing error: <data>:1:34: Expected ')' in color definition
(firefox:3028): Gtk-WARNING **: 20:59:32.381: Theme parsing error: <data>:1:77: Expected ')' in color definition
1541012374299 Marionette INFO Listening on port 36069
1541012374377 Marionette WARN TLS certificate errors will be ignored for this session
[Parent 3028, Gecko_IOThread] WARNING: pipe error (105): Connection reset by peer: file /build/firefox-4VfQCB/firefox-63.0+build2/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 356
[Parent 3028, Gecko_IOThread] WARNING: pipe error (77): Connection reset by peer: file /build/firefox-4VfQCB/firefox-63.0+build2/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 356
1541012383990 Marionette INFO Stopped listening on port 36069
1541012401502 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.UTQF5YWlr5Xt"
(firefox:3315): Gtk-WARNING **: 21:00:02.345: Theme parsing error: <data>:1:34: Expected ')' in color definition
(firefox:3315): Gtk-WARNING **: 21:00:02.345: Theme parsing error: <data>:1:77: Expected ')' in color definition
1541012403736 Marionette INFO Listening on port 34665
1541012403823 Marionette WARN TLS certificate errors will be ignored for this session
1541012404625 Marionette INFO Stopped listening on port 34665
[Parent 3315, Gecko_IOThread] WARNING: pipe error (88): Connection reset by peer: file /build/firefox-4VfQCB/firefox-63.0+build2/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 356
<html>
<head>
<title>(root)/links.html</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<br>
<button type="button" id="nothing1">Does nothing1</button>
</body>
<br>
<button type="button" id="nothing2">Does nothing2</button>
</body>
<br>
<button type="button" id="nothing3">Does nothing3</button>
</body>
</html>
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('./test.html')
element = driver.find_element_by_id('nothing2')
element.screenshot('./picture.png')
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment