I'm setting up crontab job to run my automation test script which invokes browser and does some testing.
Below is how I started setup cron job at 10:30 every day. The
.py file invokes firefox browser and does some testing
30 10 * * * python3 -u /home/Desktop/automation_script.py 2>&1 | tee /etc/cron.daily/automationlog.txt
But this ended up in an error:
Traceback (most recent call last): File "/home/automatedqa/workspace/UNIFIED_QA_TESTING/branches/AutoTestRailQA/src/nightly_run_tests.py", line 15, in <module> rack1 = rack.RACK(sys.argv, sys.argv) # the rack module contains a lot of equipment combinations which must be configured before running the tests. File "/home/automatedqa/workspace/UNIFIED_QA_TESTING/branches/AutoTestRailQA/src/rack.py", line 260, in __init__ self.driver = webdriver.Firefox(firefox_profile=fp) File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/webdriver.py", line 103, in __init__ self.binary, timeout) File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__ self.binary.launch_browser(self.profile, timeout=timeout) File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser self._wait_until_connectable(timeout=timeout) File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable raise WebDriverException("The browser appears to have exited " selenium.common.exceptions.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.
If I try to run
from the terminal, the script runs and browser invokes successfully.
It didn't work when tried to run it from crontab job.
Can anyone help me on this?