【发布时间】:2023-04-02 07:17:01
【问题描述】:
我需要一些关于 selenium-phpunit 实现的建议。 我正在使用 selenium RC 和 phpunit 与 php-webdriver-bindings 连接 phpunit 和 selenium 来执行一些自动化测试任务。
当我尝试访问 iframe 中的元素时,问题就来了。正常的 getElementBy(LocatorStrategy::id,'@requiredelement') 不起作用,因为它在使用“phpunit filename.php”运行代码时会给出“NoSuchElementException”。
根据我在一些问答中看到的内容,有一些实现可以在 java、c#、python 中的 iframe 的实现过程中更改窗口。不确定这些实现是否适用于 php。
我在 Ubuntu 12.04 上运行 phpunit 3.7 和 include_file“webdriver.php”,它是 php-webdriver-bindings 的相关函数(http://code.google.com/p/php-webdriver-bindings/ )。未检测到 iframe 中的元素。
【问题讨论】: