In these situations, or ones where your use case is quite niche, you’ll probably find yourself turning to JavaScript. This is a great thing to do if you think that others will find it useful, but you often need a solution immediately and there’s no guarantee that your pull requests won’t languish for months. One option for adding custom behavior is to implement the new functionality natively to your browser automation framework and to submit a pull request. Your specific automation framework might provide a built-in way to accomplish some of these, but they all have their limitations. You might find yourself wanting to conceal the fact that you’re using a headless browser, extract image resources from a web page, set the seed for Math.random(), or mock the browser’s geolocation before running your test suite. These generally work quite well, but you’re inevitably going to end up running into API limitations if you do a lot of testing or web scraping. Browser automation frameworks–like Puppeteer, Selenium, Marionette, and Nightmare.js–strive to provide rich APIs for configuring and interacting with web browsers.
0 Comments
Leave a Reply. |