Jupyter notebook failed to adapt to default browser - macos

I installed Jupiter notebook as part of Anaconda3. I changed to the default browser form Chrome to Safari, however, it still runs form Chrome.
To explicitly set the required browser, I created a configuration file as follow:
jupyter notebook --generate-config
and changed this line in the config file from:
# c.NotebookApp.browser = ''
to
c.NotebookApp.browser = '~/Applications/Safari.app'
I get the below error:
No web browser found: could not locate runnable browser.
How can I get Jupiter notebook to detect the default browser without explicitly configure it? If that is not possible, how to get it to work with different browser?
I am on Mac OS V. 10.12.5

I am now able to run it on Safari by set the configuration file to have:
c.NotebookApp.browser = u'open -a /Applications/Safari.app %s'
Still not sure why Jupiter doesn't recognise the default browser when configured to c.NotebookApp.browser = ''

Related

How to launch Chrome browser instead of Chromium in Taiko

How to launch a Chrome browser instead of Chromium in Taiko? I am unable to launch Chrome or another Chromium-based browser.
You can install chrome (or any chromium based browser), and these environment variables :
TAIKO_BROWSER_PATH - set this to the location of the browser executable (in this case chrome's path)
Additionally, you may set TAIKO_SKIP_CHROMIUM_DOWNLOAD to speed up taiko install, if you do not plan to use the bundled chromium.
ref: https://docs.taiko.dev/#taiko-env-variables
In windows command prompt, you can use like:
set TAIKO_BROWSER_PATH=/path/to/chrome.exe
taiko
When taiko is launched, it will display the path of the browser.
One more thing, each time you open a new cmd prompt, you need to set the TAIKO_BROWSER_PATH env variable. Or you need to set it permanently in windows global env variables.

PhpStorm debug with Laravel Homestead not working

I'm trying to setup PhpStorm to debug correctly within a Vagrant Homestead environment. Xdebug is correctly installed and I'm running PHP 7.1
After setting a breakpoint in my app the script passes through any breakpoints and I get this message:
debug session was finished without being paused
It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
To figure out the problem check path mappings configuration for 'wedleague.loc' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
I've checked the mappings and have this set up for the root of the project:
local path remote path
file://C:/vagrant/projects/wedleague /home/vagrant/code/wedleague
If I set to debug at first breakpoint I can work through the debug session.
Tried loads of answers here but nothing seems to work.
What can I try to get the debug session to work correctly?
Update:
I've also tried this mapping (as suggested)
file://C:/vagrant/projects/wedleague/public /home/vagrant/code/wedleague/public
Still not working with this configuration either :(
Step 1
Install PHPStorm 2017.X
Install Xdebug helper for chrome
Step 2
Via ssh (choose a tool like putty, WinSCP, MobaXterm etc.)
Install xdebug, in your case laravel gets Ubuntu 16.04 by default with Nginx so we need to follow these instructions
The values I used are
; Enable xdebug extension module
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_host=10.0.2.2
in /etc/php.d/xdebug.ini
But note that I use my own vagrant installation (homestead is based on Vagrant) with CentOS and apache instead. Restart your virtual machine after config changes.
vagrant / homestead halt
and start again
vagrant / homestead up
Step 3
Config Xdebug helper extension in chrome by right clicking the symbol > options and set your IDE key to PHPStorm in the dropdown menu.
Configure PHPStorm, like a lot
hint: Settings has the shortcut ctrl + alt + s
Check the following settings. Don't forget to add both http and https in the Servers Setting and most important, don't read over the path mappings part.
And last but not least click these buttons, the first button with the phone horn actually has reversed icons in my opinion: when debugging it should have the little green part, altough logically red would mean stop, now it means start.
button 2 starts your url with a session var in the query string!
P.s. from your question: I think you need to go 1 level up root of laravel instead of public folders
edit: I just installed homestead at home and it comes with xdebug installed:

Unknown option: -Dwebdriver.chrome.driver when running selenium server standalone on Mac

I was trying to manually run selenium server standalone on MAC and then run my tests with intern-runner in Chrome browser. As I've been advised on intern User Guide:
"To use ChromeDriver and IEDriver with a Selenium server, the driver executable must either be placed somewhere in the environment PATH, or their locations must be given explicitly to the Selenium server using the -Dwebdriver.chrome.driver (ChromeDriver) and -Dwebdriver.ie.driver (IEDriver) flags upon starting the Selenium server."
I started the Selenium server and put path to chrome driver on my machine, but got error:
"Unknown option: -Dwebdriver.chrome.driver"
any idea on why seleinum unable to recognize the options?
Is there any other solution on how to run chrome webdriver/IE webDriver from command line with selenium standalone server?
Where the driver executable could be placed in the environment PATH on MAC?
I was able to run chrome driver separately with out any issues using:
./node_modules/.bin/chromedriver --port=4444 --url-base=wd/hub
For selenium3 you need to use Dwebdriver.chrome.driver option first.
java -Dwebdrive.chrome.driver=path_to_chrome_driver -jar selenium_server_file
To avoid any path issues better download both files in the same directory and run from there.
Example:
java -Dwebdrive.chrome.driver=chromedriver -jar selenium-server-standalone-3.0.1.jar
Also have Chrome browser installed.
Is drive instead of driver

Selenium Web Driver does not work on xvfb

I want to run my Robot Framework tests which include Selenium2Library keywords on an Ubuntu remote machine so they should be run without a display. At first I just tried to run a simple test and get following result:
WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.
I installed xvfb in order the run headless tests and run these lines on remote shell:
sudo Xvfb :10 -ac
export DISPLAY=:10
Now i am getting the following error and I can't get rid of it
test | FAIL |
WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
I checked nearly all questions here about Selenium on xvfb and this specific error.
Since some mentioned about Selenium - Firefox incompability, I tried updating selenium (it is up to date, version 2.46.0), my Firefox was latest and i has not worked.
Then I tried using an old firefox relase (35.0) which is also not worked
Now I'm trying a solution for this problem and I am almost sure it is about fireofx.
Thanks for your answers and advices
EDIT:
->Runing tests with chrome works just fine
->Also i checked my iptables if there is a rule blocking network to local, it is in default state

How to make Selenium use localhost proxy

I have a perl based selenium script with the following statement :
$sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*chrome",
browser_url => "https://$ARGV[0]/" );
This throws up the Firefox browser. I want that when the Firefox browser is thrown up it is configured to use my proxy namely 127.0.0.1:8080 where I have a proxy service already started. How can I accomplish this without making any changes to the above shown code?
For Firefox, you need to create a profile for Selenium. Start Firefox with -ProfileManager -no-remote to be able to select this profile. Configure it accordingly.
When starting Firefox with the Selenium webdriver, you can then specify the profile to use with webdriver.firefox.profile
I couldn't find a solution to achieve the same with the Perl API. You might have to hack the sources to be able to specify the profile. Just add -P plus the name of the profile to the command line options of the browser process.
Alternatively, you can insert a script in the path variable before you run the tests. For example, on Unix:
#!/bin/bash
/usr/bin/firefox -P selenium
Save this in, say, $HOME/selenium/bin/firefox, make this new file executable and:
export PATH="$HOME/selenium/bin/firefox;$PATH"
The tests will not think that the script is the firefox executable and run that. The script will then run Firefox with the correct parameters.

Resources