Мне нужно выполнить javascript из selenium RC, у кого есть идея о том, как это сделать?Как выполнить Javascript на Selenium RC с PHP
Я попытался следующие:
написал следующую пользовательскую функцию в пользовательском extensions.js:
function sayhello() {
document.write('hello');
}
и назвал его в WelcomeCept.php следующим образом:
<?php
$I = new WebGuy($scenario);
$I->wait(3000);
selenium.getEval('sayhello');
Команда:
php codecept.phar запустить принятие WelcomeCept.php
Результат:
Codeception PHP Testing Framework v1.5.5 Powered by PHPUnit 3.7.14 by Sebastian
Bergmann.
Suite acceptance started PHP Fatal error: Call to undefined function
getEval() in
/home/user/Projects/selenium/tests/acceptance/WelcomeCept.php on line
103
FATAL ERROR OCCURRED. TESTS NOT FINISHED. Call to undefined function
getEval() in
/home/user/Projects/selenium/tests/acceptance/WelcomeCept.php:103
Он говорит: Позвонить в неопределенную функцию getEval() –
проверить, если вы получаете ту же ошибку для selenium.runscript ('sayhello()'); – Hemanth
Проверьте ссылку ниже в столбце Stackoverflow. вы можете понять. http://stackoverflow.com/questions/7321255/how-do-i-inject-a-js-function-in-my-selenium-tests – Hemanth