Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在tomcat上找不到PhantomJS页面_Java_Spring_Selenium_Phantomjs - Fatal编程技术网

Java 在tomcat上找不到PhantomJS页面

Java 在tomcat上找不到PhantomJS页面,java,spring,selenium,phantomjs,Java,Spring,Selenium,Phantomjs,我正在为SpringMVC中Glassfish上tomcat上的应用程序编写自动化测试 当我测试应用程序时,一切正常,但当我想连接到应用程序旁边时,它会得到404 例如: Glassfish这是我的应用程序 127.0.0.1:8080/网页 Tomcat: 127.0.0.1:9206/现场 日志: Info: executable: */bin/phantomjs Info: port: 5223 Info: arguments: [--ignore-ssl-errors=tru

我正在为SpringMVC中Glassfish上tomcat上的应用程序编写自动化测试

当我测试应用程序时,一切正常,但当我想连接到应用程序旁边时,它会得到404

例如:

Glassfish这是我的应用程序 127.0.0.1:8080/网页

Tomcat: 127.0.0.1:9206/现场

日志:

Info:   executable: */bin/phantomjs
Info:   port: 5223
Info:   arguments: [--ignore-ssl-errors=true, --webdriver=5223, --webdriver-logfile=*/phantomjsdriver.log]
Info:   environment: {}
Severe:   [INFO  - 2015-05-29T14:57:15.628Z] GhostDriver - Main - running on port 5223
Severe:   [INFO  - 2015-05-29T14:57:15.721Z] Session [feb4d4f0-0612-11e5-a39c-15224a5e9e7b] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Unknown; Linux i686) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.0.0 Safari/538.1","webSecurityEnabled":true}
Severe:   [INFO  - 2015-05-29T14:57:15.721Z] Session [feb4d4f0-0612-11e5-a39c-15224a5e9e7b] - page.customHeaders:  - {}
Severe:   [INFO  - 2015-05-29T14:57:15.722Z] Session [feb4d4f0-0612-11e5-a39c-15224a5e9e7b] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.0.0","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"linux-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
Severe:   [INFO  - 2015-05-29T14:57:15.722Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: feb4d4f0-0612-11e5-a39c-15224a5e9e7b
Info:   <!DOCTYPE html><html lang="en"><head>
  <meta charset="utf-8">
  <title>404 error</title>
</head>
<body>
<h1>Page not found!!!</h1>
<p>The page you requested was not found in this site.</p>
</body></html>
    DesiredCapabilities caps = new DesiredCapabilities();

    caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[]{"--ssl-protocol=any"});
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[]{"--web-security=false"});
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[]{"--ignore-ssl-errors=true"});
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, ConfigUrls.PHANTOMJS_HOME);
    caps.setCapability("page.settings.loadImages", false);
    caps.setCapability("trustAllSSLCertificates", true);
    caps.setJavascriptEnabled(true);

    driver = new PhantomJSDriver(caps);