Run Asynchronous Calls Against WebDrivers
<p>Recently, I was looking for Python libraries capable of executing asynchronous commands in WebDrivers, such as <a href="https://chromedriver.chromium.org/downloads" rel="noopener ugc nofollow" target="_blank">ChromeDriver</a> or <a href="https://firefox-source-docs.mozilla.org/testing/geckodriver/index.html" rel="noopener ugc nofollow" target="_blank">GeckoDriver</a>. Unfortunately, none of them worked, so I decided to create my own library. Hence, <a href="https://github.com/douglasdcm/caqui" rel="noopener ugc nofollow" target="_blank">Caqui</a> was born.</p>
<p>I’ve used it in another <a href="https://github.com/douglasdcm/job-conqueror" rel="noopener ugc nofollow" target="_blank">personal project</a> to search for over 2,000 job openings on over 200 recruitment websites. I reduced the time by at least 30% from the synchronous version to the asynchronous one, just by using three concurrent instances of WebDrivers. I still managed to create <a href="https://github.com/douglasdcm/caqui" rel="noopener ugc nofollow" target="_blank">Caqui</a> as an agnostic library that, in addition to executing commands in WebDrivers, runs commands in Winium, and tests Windows applications without installing anything additional. I’ll tell you a little more about it.</p>
<p>I experimented with Jmeter to test a Desktop application a few years ago. I talk more about the experiment in this <a href="https://medium.com/@douglas.dcm/testing-windows-apps-with-http-rest-b4e8f80f8b7e" rel="noopener">article</a>, so I won’t go on too long here. But basically, the experiment was to run Winium commands remotely using REST API to test the Windows Calculator. I used this knowledge to make <a href="https://github.com/douglasdcm/caqui" rel="noopener ugc nofollow" target="_blank">Caqui</a> run commands on <a href="https://github.com/2gis/Winium.Desktop" rel="noopener ugc nofollow" target="_blank">Winium</a> and WebDrivers, as described above. For this to work, it was necessary that the WebDriver be raised as a server, and its URL be used in your product, for example, a crawler.</p>
<p>Let’s take <a href="https://chromedriver.chromium.org/downloads" rel="noopener ugc nofollow" target="_blank">ChromeDriver</a> as an example. Did you know you can run it as an ordinary shell script? By doing this, a server is raised, and it listens for requests on port 9999.</p>
<p><a href="https://betterprogramming.pub/run-asynchronous-calls-to-webdrivers-e16b98b26fd9">Website</a></p>