1

I did TDD testing on AWS EC2, ubuntu. but, I have error that webdriver of selenium. I did monitoring, switch on EC2 server, but selenium didn't contact server. (Connected normally on local) So I executed 'python3' on server.

Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux

>>> from selenium import webdriver
>>> browser = webdriver.Chrome()

Traceback (most recent call last)  :
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.5/site-
packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
    desired_capabilities=desired_capabilities)
  File "/home/ubuntu/.local/lib/python3.5/site-
packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/home/ubuntu/.local/lib/python3.5/site-
packages/selenium/webdriver/remote/webdriver.py", line 188, in 
start_session
response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/ubuntu/.local/lib/python3.5/site-
packages/selenium/webdriver/remote/webdriver.py", line 252, in execute
self.error_handler.check_response(response)
  File "/home/ubuntu/.local/lib/python3.5/site-
packages/selenium/webdriver/remote/errorhandler.py", line 194, in 
check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: 
Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.26.436382 
(70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.0-1013-
aws x86_64)

The above code is the result. Help me...

K DoKy
  • 11
  • 2
  • Chrome should not start without X. You have to use something like xvfb https://stackoverflow.com/questions/7023942/running-chrome-webdriver-on-a-linux-server-with-no-display – Bishakh Ghosh May 23 '17 at 07:19
  • you need to put chromedriver in the directory from where you are calling the file – Exprator May 23 '17 at 07:32
  • This is the result of installing xvfb with reference to [Christopher Su's blog](https://christopher.su/2015/selenium-chromedriver-ubuntu/)'s blog. – K DoKy May 23 '17 at 08:07
  • `browser = webdriver.Chrome('/usr/bin/chromedriver')` `browser.get('http://staging.czarcie.com')` No errors occurred. However, it's not contacted to the app server. – K DoKy May 23 '17 at 08:20

1 Answers1

0

I solved the error.

I found the answer on TDD-Blog.

Updated python and selenium.

Thank you all.

K DoKy
  • 11
  • 2