【问题标题】:How to configure selenium webdriver script and powershell script to run once in a week如何将 selenium webdriver 脚本和 powershell 脚本配置为每周运行一次
【发布时间】:2017-02-04 14:33:56
【问题描述】:

我有一个 selenium webdriver 脚本和另一个 powershell 脚本。 我想将这两个脚本配置为在每个星期四下午 6 点运行。如何实现。

【问题讨论】:

  • 查看 Windows 任务计划程序,然后更新您的问题并尝试使其发挥作用。

标签: powershell selenium-webdriver taskscheduler


【解决方案1】:

创建 Windows 计划任务以运行 PowerShell 脚本。

这是有关如何执行此操作的分步指南。

Use-the-windows-task-scheduler-to-run-a-windows-powershell-script

然后根据您的时间表安排脚本。

如果您还想使用 PS 配置计划任务,那么这里是我的博客来帮助您。

PS Scheduled Task Script

另类,

使用 cmdlet 创建任务计划程序脚本:

powershell create scheduled-tasks

希望对你有帮助。

【讨论】:

    【解决方案2】:

    不确定 Selenium(不知道那是什么),但可以使用常规 Windows 任务计划程序来计划 PowerShell 脚本。

    可以使用 Windows 任务计划程序 (taskschd.msc) 手动创建计划任务,也可以使用 schtasks.exe 通过命令行创建,例如:

    schtasks.exe /Create /sc weekly /d THU /st 18:00 /tn MyPowerShellJob /tr "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -file d:\MyScript.ps1 \"hello world\" foo" /ru JohnDoe /rp
    

    【讨论】:

      猜你喜欢
      • 2011-06-02
      • 1970-01-01
      • 1970-01-01
      • 2013-02-16
      • 2019-03-14
      • 2011-01-05
      • 1970-01-01
      • 2015-05-26
      • 2015-05-10
      相关资源
      最近更新 更多