小编Ser*_*kiy的帖子

PhantomJS无法访问自签名HTTPS页面Codeception

我目前正在使用以下工具进行验收测试:

  • Codeception
  • Selenium Webdriver
  • PhantomJS (作为无头浏览器幽灵)

我的问题是访问自签名(https)页面时我的测试失败

我尝试过的:

  1. phantomjs --webdriver=5555 --ignore-ssl-errors=true --ssl-protocol=any
  2. phantomjs.cli.args: ["--ignore-ssl-errors=true"]在我的acceptance.suit.yml中添加这个功能

到目前为止,这些选项并没有给我任何运气.

这是我的acceptance.suit.yml档案

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver
    config:
        WebDriver:
            url: https://myproject.com
            browser: firefox
            capabilities:
                unexpectedAlertBehaviour: 'accept'

env:
    phantom:
        modules:
            enabled:
                - WebDriver
            config:
                WebDriver:
                    url: https://myproject.com
                    http_proxy: 192.1.1.1
                    http_proxy_port: 3000
                    browser: phantomjs
                    capabilities:
                        phantomjs.cli.args: ["--ignore-ssl-errors=true"]
Run Code Online (Sandbox Code Playgroud)

UPDATE

出现此错误 [ModuleException] WebDriver: Current url is blank, no page was opened

我不知道为什么这个错误发生了,因为我已经指出了一个页面.这是我的测试样本

public function tryToTestThis(AcceptanceTester $I)
{
    $I->wantTo('Test this function');
    $I->amOnPage('/mypage/');
    $I->see('This text');
}
Run Code Online (Sandbox Code Playgroud)

Codeception中的答案更可取.谢谢

ssl selenium phantomjs codeception

7
推荐指数
1
解决办法
688
查看次数

用sed,line cut提取sql插件

我一直在阅读有关使用sed从sql转储中提取数据的stackoverflow ,更准确,最终目的是提取特定表的插入,以便仅恢复该表.

我正在使用这个:

sed -n '/LOCK TABLES `TABLE_NAME`/,/UNLOCK TABLES/p' dump.sql > output.sql
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是我们在1行上插入超过50Mb的插入,因此在提取插入时,输出会在行结束之前被切断.喜欢:

......
(4
3458,'0Y25565137SEOEJ','001','PREPAR',1330525937741,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(43459,'666
Run Code Online (Sandbox Code Playgroud)

我尝试使用awk甚至简单grep,结果是一样的,线被切断.

编辑:我在mysql的sql转储上使用它,我正在使用的系统是Centos 5.2

linux awk grep sed mysqldump

5
推荐指数
1
解决办法
583
查看次数

标签 统计

awk ×1

codeception ×1

grep ×1

linux ×1

mysqldump ×1

phantomjs ×1

sed ×1

selenium ×1

ssl ×1