HtmlUnit +生产中的硒 [英] HtmlUnit + Selenium within Production

查看:63
本文介绍了HtmlUnit +生产中的硒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的生产代码中使用HtmlUnit和Selenium来驱动它(WebDriver).

I am currently using HtmlUnit and Selenium to drive it (WebDriver) within my production code.

我正在使用这些库通过编程与各种网站进行交互,并取得了一些成功,并且没有遇到内存问题(确保始终清理会话).

I am scaping and interacting with various websites programmatically with these libraries and am having some success and not experiencing memory issues (ensuring sessions are always cleaned up).

我想知道这些库是否适合生产环境或推荐使用.由于存在大量有关自动化测试的信息,而不是我的使用方式,因此很难通过Google来找到它.

I am wondering if these libraries are okay for a production environment or recommended against. This is difficult to find via Google due to the enormous amount of information about automated testing rather than how I am using them.

我意识到这是一个相当普遍的问题,但是我正在寻求有关这些库以及可能更好的替代方案的建议.

I realise this is a fairly generic question, but I am seeking advice on these libraries and potentially better alternatives.

推荐答案

WebDriver和Selenium非常适合生产环境.我在一个多机/多数据中心的分布式网格上使用它们已有2年之久,并且绝对没有我们无法解决的性能或稳定性问题.

WebDriver and Selenium are perfectly suited for production environnement. I use them quite extensively for 2 years now on a multi-machines/multi-datacenters distributed grid and had absolutely no performance nor stability problems we couldn't have coped with.

我们首选的驱动程序是Firefox(比HTMLUnit重,并且更难配置),并且我们不得不调整网格以了解可以运行多少个实例.我们最大的稳定性是每个核心1个

Our preferred driver is the Firefox one (heavier than HTMLUnit, and harder to configure), and we had to tweak the grid to understand how many instances we can run. Our maximum for stability was 1 per core

我们的selenium/webdriver实例已经运行24/7了2年(使用硒1,其他一年逐步迁移selenium 2/WebDriver一年),并进行了适当的监控(您应该监控内存使用/CPU使用情况)和大量的负载测试,我们达到了良好的水平,经历了几个月的经验,而无需重新启动流程

Our selenium/webdriver instances have run 24/7 for 2 years now (1 year with selenium 1, and the other migrating selenium 2/ WebDriver incrementally) and with an appropriate monitoring (you should monitor Memory Usage/CPU Usage) and a bunch of load testing, we had reached the good level where we have experienced several monthes without restarting a process

我们也广泛使用了HTMLUnit,并且对该库同样满意

We've used HTMLUnit extensively too, and are equally satisfied with this library

我的帖子的重点是:是的,这些库已经可以投入生产了.但是,作为所有生产软件,您必须对它们的使用进行基准测试,以找到合适的配置以获得最佳稳定性.我建议您在生产中使用Selenium Grid,这是使流程并行化的好方法

The essential point of my post is : YES, these library are production-ready. But, as all production software, you'll have to benchmark their use to find the appropriate configuration for the optimal stability. I recommend you to use the Selenium Grid in production, which is a great way to parallelize process

这篇关于HtmlUnit +生产中的硒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆