How to open a new tab using Selenium WebDriver in Java?

Just for anyone else who’s looking for an answer in Ruby, Python, and C# bindings (Selenium 2.33.0). Note that the actual keys to send depend on your OS. For example, Mac uses CMD + T, instead of Ctrl + T. Ruby require ‘selenium-webdriver’ driver = Selenium::WebDriver.for :firefox driver.get(‘http://stackoverflow.com/’) body = driver.find_element(:tag_name => ‘body’) body.send_keys(:control, ‘t’) … Read more

Targeting only Firefox with CSS

OK, I’ve found it. This is probably the cleanest and easiest solution out there and does not rely on JavaScript being turned on. @-moz-document url-prefix() { h1 { color: red; } } <h1>This should be red in FF</h1> It’s based on yet another Mozilla specific CSS extension. There’s a whole list for these CSS extensions … Read more

Why doesn’t percentage padding / margin work on flex items in Firefox and Edge?

2018 Update The flexbox specification has been updated. 4.2. Flex Item Margins and Paddings Percentage margins and paddings on flex items, like those on block boxes, are resolved against the inline size of their containing block, e.g. left/right/top/bottom percentages all resolve against their containing block’s width in horizontal writing modes. Original Answer – applies to … Read more

Which Firefox browser versions supported for given Geckodriver version?

This Question have been surfacing out quite often for sometime now since we migrated from the legacy Firefox releases to Marionette based Mozilla Firefox releases (beginning with Firefox 48). It is not clear what exactly you mean by the code was working with geckodriver-v0.16.1 for older firefox versions. In general, each GeckoDriver release supports each … Read more

Custom CSS Scrollbar for Firefox

As of late 2018, there is now limited customization available in Firefox! See these answers: https://stackoverflow.com/a/54101063/405015 https://stackoverflow.com/a/53739309/405015 And this for background info: https://bugzilla.mozilla.org/show_bug.cgi?id=1460109 There’s no Firefox equivalent to ::-webkit-scrollbar and friends. You’ll have to stick with JavaScript. Plenty of people would like this feature, see: https://bugzilla.mozilla.org/show_bug.cgi?id=77790 As far as JavaScript replacements go, you can try: … Read more

JavaScript open in a new window, not tab

Specify window “features” to the open call: window.open(url, windowName, “height=200,width=200”); When you specify a width/height, it will open it in a new window instead of a tab. See https://developer.mozilla.org/en-US/docs/Web/API/Window.open#Position_and_size_features for all the possible features.