简体   繁体   中英

pause and resume Selenium execution

I am looking for an option to pause and resume Selenium execution.

  1. start the selenium execution

2. pause at a certain step explicitly by some means (commandline/in-line code/manually)

  1. continue execution

I know that we can keep

Thread.sleep()

or

time.sleep

I want to give the pause dynamically in between the execution of a test case.

Programming language can be Java or Python.

is there a way in java or python to pass a pause to the execution dynamically?(probably that can help)

Any thoughts and solutions are greatly appreciated.

使用IDE,设置断点并调试脚本。

For Python, use can use pdb for debugging. Just drop the following line at the step where you want to pause and it will drop you into the debugger. You might have to get a little familiar with pdb

import pdb; pdb.set_trace()

I found a way where we can do dynamically(no explicitly mentioning breakpoints or typing a line of code at a particular step).Get the process ID of my selenium script and fire below two commands for pausing and continuing whenever I want.

kill -SIGSTOP [pid]

kill -SIGCONT [pid]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM