关于PHPUnit的Selenium 2文档到底在哪里? [英] Where the heck is any Selenium 2 documentation for PHPUnit?

查看:81
本文介绍了关于PHPUnit的Selenium 2文档到底在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了在源代码和测试中可以查看"以弄清楚"的源代码和测试之外,我正试图在Selenium 2上找到有关PHPUnit的任何信息,这让我很沮丧.每个人的最爱似乎是

I'm having a frustrating time trying to find any information on Selenium 2 for PHPUnit except for source code and tests that I can "look through" to "figure it out". Everyone's favorite seems to be

https://github.com/sebastianbergmann/phpunit-selenium/blob/master /Tests/Selenium2TestCaseTest.php

...但是我当然不必挖掘数百行资源来获得简单问题的答案?在哪里可以找到初学者指南,基本文档或其他内容?

...but surely I don't have to dig through hundreds of lines of source to get answers to simple questions? Where can I find a beginner's guide, basic documentation, or anything?

推荐答案

达到了啊哈的时刻.将为下一个可怜的灵魂在这些荒凉的混乱领域中徘徊而张贴.

Ah-ha moment reached. Will post for the next poor soul wandering in these desolate fields of confusion.

Selenium 说"Selenium 2"时,他们喜欢说"Selenium 2 = Selenium服务器+ WebDriver".

When Selenium says "Selenium 2", they like to say "Selenium 2 = Selenium server + WebDriver".

PHPUnit人士的窍门是WebDriver部分,它不是PHPUnit中的相当. Selenium用其他几种语言编写了WebDrivers,还有一些针对PHP的第三方语言,自从我现在瞄准PHPUnit以来,我还没有尝试过. WebDriver基本上是在DOM中运行并获取元素的一种方式. http://docs.seleniumhq.org/docs/03_webdriver.jsp .

The trick for the PHPUnit person is the WebDriver part, which is not quite in PHPUnit. Selenium has written the WebDrivers in a few other languages, and there's third party ones for PHP which I haven't tried since I'm targeting PHPUnit for now. The WebDriver is basically a way of running around in the DOM and grabbing elements. It's got a good rundown at http://docs.seleniumhq.org/docs/03_webdriver.jsp.

PHPUnit 说"Selenium 2"时,表示他们已经编写了类,这些类在WebDriver中完成了大部分任务.他们没有将其称为WebDriver,而是将其称为Selenium 2.

When PHPUnit says "Selenium 2", they mean that they've written classes which do most of the stuff in a WebDriver, but they're not calling it a WebDriver, they're calling it Selenium 2.

由于是PHPUnit的自制版本,因此它们的方法命名与Java或C#版本略有不同.这就是为什么每个人都对 PHPUnit测试用例如此兴奋的原因,因为在网络驱动程序文档中找到所需的方法后,它很容易猜测您要查找的内容.

Because of PHPUnit's homebrewed version, their methods are named a little differently than the Java or C# versions. This is why everyone is so excited about the PHPUnit test case because it makes it easy to guess what you're looking for after you've found the method you want at the webdriver docs.

否则,显然,PHPUnit中的大多数其他功能都将保留原始的SeleniumTestCase内容.我在下面整理了一些链接,以使我的信息有所集中.硒1不是死"的,但它是旧的. PHPUnit从其Selenium 1的实现中仍然使用许多体系结构,而PHPUnit的Selenium 2并非如此,而是Selenium 1 ++的一种.

Otherwise, apparently most of the other functionality in PHPUnit sticks to the original SeleniumTestCase stuff; I've compiled a few links below to centralize my info somewhat. Selenium 1 is not "dead", but it is old. PHPUnit still uses a lot of architecture from its implementation of Selenium 1, and PHPUnit's Selenium 2 is not really that, but sort of Selenium 1++.

因此,没有理由去寻找源代码,只需尝试将PHPUnit测试用例与WebDriver文档进行匹配即可.另外,本教程中用于SeleniumTestCase的一些方法已更改了Selenium2TestCase中的名称,但请不要担心,该操作仍然起作用,只是有些混淆.

So, there's no reason to go hunting through the source, just try to match the PHPUnit test cases to the WebDriver docs. Also, a few methods in the tutorial for SeleniumTestCase have changed names in Selenium2TestCase, but fear not, the thing still works the same, just a little obfuscated.

您可能会问:为什么不只使用SeleniumTestCase?"好吧,似乎对其他浏览器的支持需要WebDriver,因此,如果您想退出Firefox,则需要Selenium2TestCase(我可能错了).

You may ask, "Why not just use SeleniumTestCase?" Well, it seems that support for other browsers requires the WebDriver, so if you want to get out of Firefox, you'll need Selenium2TestCase (I could be wrong).

在我抓取以下内容时,发现了一些有用的链接:

Here's some helpful links I found as I scraped away at this:

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