有PHP的HtmlUnit端口吗? [英] Is there an HtmlUnit port for PHP?

查看:167
本文介绍了有PHP的HtmlUnit端口吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java库 的HtmlUnit可以让你请求一个给定的URL的内容(我叫它也将执行将在该页面的加载事件上执行的javascript)。我正在寻找此相同的功能,但在PHP。



这是我试图解决的问题是,我试图卷曲/ wget的/ get_file_contents到url,有一点javascript的页面加载运行...这个javascript不是用我正在使用的方法执行...我想使用的东西,可以实现get,另外执行



感谢

div class =h2_lin>解决方案

我google了一点,但找不到端口。例如此链接告诉任何端口可用。


要测试cartoclient的功能,使用HttpUnit软件。它
是用Java编写的,并且没有Php端口。该HTTP单元测试是
都正常运行,如果你对你有路径的JVM




可能的 PHPUnit的使用Selenium RC




Selenium RC是一个测试工具,允许您使用任何主流浏览器对任何HTTP网站使用任何编程语言
为Web应用程序编写自动化
用户界面测试。它使用
Selenium Core,一个使用
JavaScript执行自动浏览器任务的库。 Selenium测试直接在浏览器中运行,就像真正的
用户一样。这些测试可用于验收测试(通过
在集成系统上执行更高级别的测试,而不是仅仅
独立地测试系统的每个单元)和浏览器
兼容性测试(通过测试在不同的
操作系统和浏览器上的web应用程序)。



The Java library HtmlUnit allows you to request a given url's content (and I'm told it will also execute the javascript that would execute on that page's load event). I'm looking for this same functionality but within PHP.

The problem that I'm trying to solve is that I'm attempting a curl/wget/get_file_contents to a url that has a bit of javascript that run on page load...this javascript is not executing with the methods that I'm using...and I'd like to use something that can achieve the "get" and additionally execute that page's javascript...so my result from the "get" would be the html markup after the initial javascript has executed.

Thanks

解决方案

I googled a bit but could not find a port. For example this link tells that no port is available.

To test features of the cartoclient, the HttpUnit software is used. It is written in Java, and there is no Php port. The http unit tests are run if you have a JVM in you path.

Maybe PHPUnit with Selenium RC?

Selenium RC is a test tool that allows you to write automated user-interface tests for web applications in any programming language against any HTTP website using any mainstream browser. It uses Selenium Core, a library that performs automated browser tasks using JavaScript. Selenium tests run directly in a browser, just as real users do. These tests can be used for both acceptance testing (by performing higher-level tests on the integrated system instead of just testing each unit of the system independently) and browser compatibility testing (by testing the web application on different operating systems and browsers).

这篇关于有PHP的HtmlUnit端口吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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