How to open local html file by Selenium Safari WebDriver on macOS? - selenium

I have tried:
safariDriver.get("file:///Users/pathToMyHtml/index.html");
safariDriver.get("/Users/pathToMyHtml/index.html");
but none of them worked. I use Java and macOS Sierra.
(If I open a page from http:// it's working)

The root cause is Selenium version. You need to upgrade Selenium to version 3++.
It works fine on my machine with Selenium 3.4.
See issue at: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/3773

Related

How to replace Chrome with PhantomJS for use with Selenium and Conductor?

I am successfully using the Conductor framework to scrape data off a website. I use the Chrome browser and therefore I have installed chromedriver.exe in the root of my project.
To speed things up I want to replace Chrome with the headless PhantomJS browser. I installed PhantomJS as explained in the answer to this Stackoverflow question: PhantomJS & Conductor Framework and have changed the browser to Browser.PHANTOMJS in #Config.
Whatever I do however, I get no results.
I found no documentation how to setup PhantomJS for use with Selenium or PhantomJS.
The question How to Implement Selenium WebDriver with PhantomJS and Can we Use Sikuli with PhantomJS? did not help either.
How to replace Chrome with PhantomJS for use with Selenium and Conductor?
The trouble you are having appears to be due to an older version of the PhantomJS library included in Conductor. The error when running PhantomJS can be found in this imported issue on the Selenium Github. The remedy is to import a fork of PhantomJS which works with the newer releases of Selenium.
You can easily implement this by editing the pom.xml file and swapping
<groupId>com.github.detro</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>${phantomjs_version}</version>
with
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.2.1</version>
You can use a headless chrome driver with selenium, as showed here:
https://duo.com/decipher/driving-headless-chrome-with-python

Watir webdriver: Doesn't do anything after opening browser (firefox)

It was working fine before, now whenever I run the script it just opens Firefox then does nothing. It works when running with chromedriver though.
Tried updating gems etc, but no success.
The latest Firefox version will no longer work with the legacy Firefox Driver. To use Watir with Firefox 48+ you need to download geckodriver and follow the instructions for Ruby.
Since Geckodriver is not yet feature complete, you most likely will want to continue using the legacy Firefox Driver, which means either using Firefox ESR or downgrading to Firefox 47.0.1.

Firefox v45 doesn't start on it own

I recently uninstalled Mozilla Firefox v47 becuase it was not working with Selenium WebDriver. I then installed Firefox v45.0 which is working successfully with Selenium WebDriver.
The problem is that now, cant open Firefox on it own. I double click the application icon and nothing happens. I have tried to run it as an admin, from the program files folder and still nothing happens.
I have no idea how to identify what's wrong.
Any help will be appreciated.
I had the same problem, try to install version 46 of Firefox (it works with the latest version of selenium WebDriver) :
https://ftp.mozilla.org/pub/firefox/releases/46.0.1/

How to run the selenium code on linux using firefox without GUI?

I had redhat Linux server command line but there is no GUI for that and I need to run selenium code on this server with firefox. As I am new to selenium so I am not sure whether it will work or not.
For achieving this I had install Firefox on my Redhat linux machine successfully but not able to trigger that as it is showing no display found.
Is there any other way to achieve this for headless browsing, where virtually a firefox will be opened and selenium code can be executed without GUI. Is it possible to do??
You can use HtmlUnitDriver of selenium to use headless browsing but it will not open firefox and may be not loading all content to it's cache as same as firefox
Refer Below:-
https://code.google.com/p/selenium/wiki/HtmlUnitDriver
Another thing you can use is Phantomjs with selenium Webdriver. This is most using pattern by industries for headless browsing
Refer below:-
http://www.guru99.com/selenium-with-htmlunit-driver-phantomjs.html
Yes you can trigger selenium file using command line
http://www.tutorialspoint.com/testng/testng_executing_tests.htm
Bash file is running fine in windows for testng but it is not working in linux/mac
Now if still your firefox is not opening then it is basically issue of some setting with your OS with firefox
Refer that too :-
https://serverfault.com/questions/279036/open-terminal-via-ssh-run-firefox-display-not-found
May be you have problem with some permission in red hat
Hope it will help you :)

Selenium not working in firefox 23.0.1 (Mac and Windows)

I have a client who had a script working and now stopped working. I run it in my computer and it works (i runned it on Linux and Windows). My client runned it on Mac and Windows.
I am new to Selenium, but the part of the code that crashes is where Selenium takes place, it gets the Firefox to open but not load the page. I think it migth be a problem with the webDriver of Selenium that must be updated.
I told him to install pip in his Mac and uninstall Selenium and reinstall it, is this how it is done in OS machines? Is there any issue related to my problem?
Thanks
It would be helpful if you had specify Selenium version and also which browser are you using and it's version too. But the behavior you described seems to be caused by having newer version of browser which the Selenium version you using doesn't support. So upgrading to newest version of Selenium (2.35) will likely make this problem disappear.