我需要一些關於selenium-phpunit實現的建議。 我正在使用selenium RC和phpunit與php-webdriver-bindings連接phpunit和selenium來執行一些自動化測試任務。Selenium-PHPUnit訪問IFrame中的元素時出錯
的問題來了,當我試圖訪問存在於iframe元素。正常的getElementBy(LocatorStrategy :: id,'@ requiredelement')不起作用,因爲它使用「phpunit filename.php」運行代碼時會產生「NoSuchElementException」。
在某些Q & As中,有一些實現用於在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中的元素沒有被檢測到。
@ user1732420幫助? –
很抱歉這麼晚回覆。它實際上工作。感謝您的建議。 $的這個值應該從加載頁面改變到實質上使iframe作爲父頁面的框架。 – suppa5890