无法使用PHPunit Selenium执行javascript [英] Unable to execute javascript using PHPunit Selenium

查看:61
本文介绍了无法使用PHPunit Selenium执行javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用PHPUnit命令执行javascript代码.它执行PHP代码并发送电子邮件和其他内容.

I am trying to execute a javascript code using PHPUnit Command. It executes the PHP code and sends email and other stuffs.

但是该php文件中有一些javascript代码,可将一些数据发送到第三方url.这似乎不起作用.

But there is some javascript code inside that php file that sends some data to third party url. That seems to be not working.

有没有想到如何执行javascript代码?

Any thoughts as how to execute the javascript code?

推荐答案

适用于那些正在使用PHPUnit_Extensions_Selenium2TestCase并从Google寻求帮助的人.

For those who are using PHPUnit_Extensions_Selenium2TestCase and come hia from google.

@请参见 https://github.com/sebastianbergmann/phpunit-selenium/issues/160

应为:

$this->execute(array(
    'script' => $javaScriptCode,
    'args'   => array()
));

这篇关于无法使用PHPunit Selenium执行javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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