小编Chu*_*hoo的帖子

Rails-4,ExecJS :: PagesError中的ProgramError#welcome

我正在尝试将登录注销功能添加到我的rails应用程序中.为此,我添加了bcrypt用于密码加密的gem以及访问控制器.现在当我在本地运行它时,我收到一条错误消息.在添加上述功能之前,我的应用运行正常.

错误信息:

TypeError: Object doesn't support this property or method
(in C:/DevKit/lib/ruby/gems/1.9.1/gems/turbolinks-2.5.3/lib/assets/javascripts/turbolinks.js.coffee)

Extracted source (around line #8):

<head>
  <title>PostApp</title>
  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track'=>true %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track'=>true %>  ----> Line 8

      <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
      <%= csrf_meta_tags %>
Run Code Online (Sandbox Code Playgroud)

的Gemfile:

source 'http://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use sqlite3 as the database for Active Record
group :development do
  gem 'sqlite3' 
end
group :production do
  gem 'pg'
end
# Use …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails-4

10
推荐指数
1
解决办法
2万
查看次数

如何通过 mvn 命令行传递 testng.xml 参数值

下面的testng.xml文件有三个参数。我不希望参数customerCode被硬编码。我想将变量/差异传递customerCode给以下testng.xml文件,但我也希望将 Peter 作为默认值customerCode,以防万一我不通过mvn命令行提供一个,如下所示:

mvn test -DcustomerCode=customer1 -Ptestng.xml
Run Code Online (Sandbox Code Playgroud)

下面是testng.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TestSuite" parallel="false">

    <test name="someTest">
        <parameter name="browserType" value="chrome_win"></parameter>
        <parameter name="Url" value="http://regression.mytest.com/?customerCode=" />
        <parameter name="customerCode" value="Peter"/>

        <groups>
            <run>
                <exclude name="navigateToHomePage" />
            </run>
        </groups>
        <classes>
            <class name="com.automation.customermanagement.createTest.myIntegrationTest" >
            <methods>
                <exclude name="deleteCustomer" />
            </methods>
            </class>
        </classes>
    </test>
</suite>
Run Code Online (Sandbox Code Playgroud)

我如何做到这一点?有没有办法做到这一点?

下面是我的 POM 文件。我将customerCode属性放在配置文件中的什么位置?

<profile>
    <id>AddMgmtTest</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration> …
Run Code Online (Sandbox Code Playgroud)

java xml maven selenium-webdriver

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

线程"main"中的异常java.lang.NoSuchFieldError:INSTANCE

我正在尝试使用HTTPClient编写一个简单的WebService测试.我已经装满了所有的罐子但是得到了上面的错误信息.

为什么我收到此错误消息?

这是代码:

package HTTPClientTest;

import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.HttpClientBuilder;
import org.junit.Assert;


public class RESTTester {

    public static void main (String args[]) {

    String restURL_XML = "http://parabank.parasoft.com/parabank/services/bank/customers/12212/";


    try {

    testStatusCode(restURL_XML);

    } catch (ClientProtocolException e) {

    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } 
}


public static void testStatusCode(String restURL) throws ClientProtocolException, IOException {
    HttpUriRequest request = new HttpGet(restURL);
    HttpResponse httpResponse = HttpClientBuilder.create().build().execute(request);
    Assert.assertEquals(httpResponse.getStatusLine().getStatusCode(),HttpStatus.SC_OK);
    }

}
Run Code Online (Sandbox Code Playgroud)

下面是错误堆栈跟踪,

Exception in thread "main" java.lang.NoSuchFieldError: …
Run Code Online (Sandbox Code Playgroud)

java httpclient

2
推荐指数
1
解决办法
1万
查看次数

java.lang.IllegalStateException:驱动程序不可执行:/resources/phantomjs-2.1.1-linux-x86_64/bin/phantomjs

我试图在Jenkins(Unix)中以无头模式运行selenium UI测试.我正在使用正确版本的phantomJS for unix环境.

phantomjs-2.1.1-linux-x86_64/bin/phantomjs
Run Code Online (Sandbox Code Playgroud)

我得到了上面提到的错误.任何见解?如果需要,我会提供更多细节.

java.lang.IllegalStateException: The driver is not executable: /resources/phantomjs-2.1.1-linux-x86_64/bin/phantomjs
Run Code Online (Sandbox Code Playgroud)

java linux selenium jenkins phantomjs

2
推荐指数
1
解决办法
2953
查看次数