chrome browser is not opening with robot framework - python-2.7

getting error : WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed
getting above error while running a robot script:
It is a simple code to open you tube in chrome browser.
it looks like this:
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${Browser} Chrome
${URL} https://www.youtube.com/
*** Test Cases ***
TC1
Open Browser ${URL} ${Browser}
Input Text name:search_query ted talk
Click Button id:search-icon-legacy
It is on ubuntu
using python2.7
robotframework==3.0.2
robotframework-mqttlibrary==0.7.0
robotframework-selenium2library==1.8.0
robotframework-seleniumlibrary==4.3.0
ChromeDriver 80.0.3987.106
I tried updating chrome and chrome driver also.
I don't know what am i doing wrong,
please help.

You are trying with robotframework-seleniumlibrary==4.3.0 & robotframework==3.0.2
Update the robotframework-seleniumlibrary 4.3.0 to 3.0.1
pip install robotframework-seleniumlibrary==3.0.1
Add capabilities
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_experimental_option w3c ${False}
Call Method ${chrome_options} add_argument no-sandbox
Call Method ${chrome_options} add_argument disable-setuid-sandbox
Call Method ${chrome_options} add_argument disable-dev-shm-usage
Call Method ${chrome_options} add_argument disable-single-click-autofill
Wait Until Keyword Succeeds 2x 1s
... Create WebDriver Chrome alias=${Browser} chrome_options=${chrome_options}
Go To ${URL}
Input Text name:search_query ted talk
Click Button id:search-icon-legacy

Related

Shiny server: Fatal error: unable to open the base package

I just installed shiny server and I get an error when I load the shiny web page:
An error has occurred. The application failed to start shows on the right side of the screen.
Then I checked the log and shows:
su: ignore --preserve-environment, it's mutually exclusive to --login.
Fatal error: unable to open the base package
When I type su - shiny and I try to run R I also get the Fatal error: unable to open the base package, so I guess there is a problem with R.
I can load R when I'm root or R user and apparently R works fine.
Any idea? Could it be a PATH problem? If yes, I couldn't find it out.
Thanks in advance.

chromedriver has stopped working

I'm totally new to selenium and when I wrote this piece of code, I'm getting an error from chrome saying "chrome driver has stopped working" and it asks me to close chrome or not.
from selenium import webdriver
chrome_path="C:\Python27\Scripts\chromedriver.exe"
driver=webdriver.Chrome(chrome_path)
driver.get("https://www.google.com")
After I execute this line in my IDLE
driver=webdriver.Chrome(chrome_path)
Chrome opens but says "You are using unsupported command line flag: -- ignore-certificate-errors. Stability and security will suffer." and it pops up a dialog box telling me to "Disable developer mode extensions"
After I type this line
driver.get("https://www.google.com")
A dialog box appears saying chromedriver.exe has stopped working and it gives me a button to close program. Sometimes this doesn't appear straight away, I get some error on IDLE GUI like this. Click me for the error image
Few details :-
Chrome Version :- 60.0.3112.101
chromedriver version :- 2.9.248315
Python version :- 2.7.13
Please upgrade to the newest chromedriver version.
Link to chromedriver

How do I bypass marionette issues in Robot?

I've been asked to evaluate Robotframework and happy with what I've seen for the most part. For it to be a viable option for me however, I need it to work in Firefox.
Marionette capabilities were a problem in my Ruby/Capybara environment, and I was able to shut it off.
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :firefox, desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false))
end
Getting the same thing in Robot / Python 2.7 / ff44.0 has generated an error in either direction.
When marionette is on:
${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
Set To Dictionary ${dc} marionette=${True}
Open Browser ${url_bck_auto} Firefox desired_capabilities=${dc}
I get this:
Our products rock | FAIL |
WebDriverException: Message: Unsupported Marionette protocol version
2, required 3
If I turn it off, gecko bumps me to ff51.0.1(32-bit) and I get a different message:
Our products rock | FAIL |
WebDriverException: Message: Can't load the profile. Possible firefox
version mismatch. You must use GeckoDriver instead for Firefox 48+.
Profile Dir: c:\users\blah\appdata\local\temp\tmpqzlxha\webdriver-
py-profilecopy If you specified a log_file in the FirefoxBinary
constructor, check it for details.
Geckodriver is version 0.15.0
Any help will be appreciated, thanks!
On Windows 10 I'm running Robot Framework 3.0, Selenium2Library 1.8.0, Selenium 3.0.2 and when I start your example, or the simplified single open browser http://google.com I get the same result when using Gecko 0.15.0. The browser starts but does not move to the desired page. The driver closes successfully but the browser stays open.
When using the same setup, but downgrading Geckodriver to 0.14.0 the results change, and the browser behaves as expected. Loads the page and closes when Close Browser keyword is called.
So, I recommend downgrading to Geckodriver 0.14.0.

Ember CLI throws Unhandled 'error' event message

Ember CLI works great most of the time on my laptop. However, once in a while (very very occasionally) when I ctrl + c the ember server process and restart it, it throws the following error and refuses to start again until I do a complete system restart (I am on a Mac):
MacBook-Pro:client-web User$ ember server
version: 1.13.6
Could not find watchman, falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
2015-09-04 17:46 ember[1102] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
2015-09-04 17:46 ember[1102] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
2015-09-04 17:46 ember[1102] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
events.js:85
throw er; // Unhandled 'error' event
^
Error: watch EMFILE
at exports._errnoException (util.js:746:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1157:26)
Why does this happen? I want to avoid doing system restarts.
Adding this as an answer because the Ember CLI docs no longer mention it, and it took me a while to track down:
Frequently, this problem is caused by Sublime Text watching the same files as the Ember server. If you're using Sublime and encountering this error, try closing Sublime and running the server again. To keep it from recurring, you can tell Sublime Text to ignore the tmp directory, by adding "tmp/*" to the"folder_exclude_patterns" in your Sublime user settings.

Python script hangs on ubuntu server using selenium firefox driver

I'm trying to take screenshots of some webpages. I opted for selenium and firefox. I'm using xvfb and setting an environment variable for the display.
The script works fine without xvfb on OS X desktop. However on the server the script hangs after webdriver.Firefox() is issued as if the python script is no longer executing. No exception is ever raised and firefox is still active in my process list.
Setup:
sudo Xvfb :10 -ac
export DISPLAY=:10
test.py
from selenium import webdriver
print 'start'
firefox = webdriver.Firefox()
print 'Hello?'
firefox.quit()
print 'done!'
output:
start
cursor winks tauntingly
I Had the same problem with Chrome. Also tried the phantomJs flash fork, this was successful but did not capture flash content.
starting independently firefox gives
(process:3278): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' f failed
Xlib: extension "RANDR" missing on display ":10".
Error: Access was denied while trying to open files in your profile directory.
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
(firefox:3278): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
//bin/dbus-launch terminated abnormally without any error message
Please help
Thanks!