seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.46k stars 909 forks source link

Excessive CPU and RAM usage #2744

Closed Ashish3080 closed 2 months ago

Ashish3080 commented 2 months ago

While trying to record and playback browser actions, the recorder after 2-3 trials starts to occupy the entire RAM which inevitably makes the entire system slow. I tried it on different systems, but the issue still persists. Any solution for that? For recording I am using :- sbase mkrec my_test.py --url=imdb.com For playback I am using :- pytest my_test.py

mdmintz commented 2 months ago

I'm unable to reproduce that. Be sure to finish your recordings by typing c in the console and pressing Enter to continue from the Python breakpoint().

Ashish3080 commented 2 months ago

is there any other way to stop the recording other than entering c?

mdmintz commented 2 months ago

You can use the Recorder without manual intervention. For example:

pytest --rec

That runs the Recorder on scripts, which optimizes the selectors that were used.

To print the results / output immediately, use:

pytest --rec-print