ive got the program that recognizes captcha. And i need in SeleniumBase test do the next steps:
- download captcha png, save it somewhere in system folder
- run batch file to process downloaded png
- result is saved in txt, read the result
import os
from seleniumbase import BaseCase
class captcha():
os.system("C:\\captcha\\run_captcha.bat" + " 1.png C:\\captcha\\ 1")
class LoginTest(BaseCase):
def test_login(self):
self.open ("url")
self.save_element_as_image_file("#CaptchaControl1_CaptchaImage", "1", r"C:\\captcha")
#os.system("C:\\captcha\\run_captcha.bat" + " 1.png C:\\captcha\\ 1") returns INTERNALERROR if called here
captcha()
but there is the problem: somehow the result of the run_captcha.bat appears before seleniumbase opens the browser and downloads the image how to execute batch after downloading the image?