3

I have a Selenium Python test and I can run it from the batch file as follows:

set TEST_HOME=%~dp0
cd %~dp0

SET PATH=%PATH%;G:\test_runners\selenium_regression_test_5_1_1\IEDriverServer\64bit

cd %~dp0selenium_regression_test_5_1_1

set PYTHONPATH=%~dp0selenium_regression_test_5_1_1

c:\Python27\Scripts\nosetests.exe "%~dp0selenium_regression_test_5_1_1\Regression_TestCase\split_into_parts\RegressionProject_TestCase_Part1.py" --with-html --html-file="%~dp0selenium_regression_test_5_1_1\TestReport\SeleniumTestReport_part1.html"

I need to run this batch file through Task Scheduler. I have setup the task in task scheduler and when it runs the test fails because the browser does not open. The dev says the Task Scheduler runs in the background, headless browser. It will not open the browser. Can I not run this batch file from Task Scheduler?

How can i get the batch file which runs the Selenium test to run from Task Scheduler?

Thanks, Riaz

1
  • this isn't the issue with Task Scheduler, it's the batch doesn't run the Selenium. i faced the same issue with python 3.7 stackoverflow.com/questions/57930453/… Commented Sep 13, 2019 at 21:44

1 Answer 1

1

I have got it to run now. In Task Scheduler to run the task as not hidden the setting radio button "Run only when user is logged on" should be checked.

The browser then open for the Selenium test when the batch file runs.

Many users have faced this issue: I found the solution from here: http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/why-is-a-windows-7-scheduled-task-running-hidden/d5196c53-5ebd-40a9-8180-d97bde69d060?auth=1

Sign up to request clarification or add additional context in comments.

1 Comment

it's not the issue with Task Scheduler, it's the batch doesn't run the Selenium

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.