3.4 버전 설치하여 샘플 스크립트 GET 타입 google.co.kr로 설정하여 테스트 생성시 validate 에러가 발생하여 문의드립니다.
jdk 1.8.0_101 apache_tomcat8.5.4 centos 6 64bit 다음과 같은 에러가 발생 하였습니다 POST도 동일 했습니다 ERROR validation-0: aborting process - Jython exception: <type 'exceptions.SyntaxError'>: ("mismatched input '&' expecting RPAREN", ('${NGRINDER_HOME}/script/admin/gsdfgaf.py', 22, 16, 'test1 = Test(1, "google.com")\n')) jdk1.7로 변경 후 3.3 사용시엔 정상적으로 동작 하는것을 확인 하였습니다. 3.4버전 사용함에 있어서 문제 있는 부분이 있었을까요? |
생성된 샘플 코드 입니다
# -*- coding:utf-8 -*- # A simple example using the HTTP plugin that shows the retrieval of a # single page via HTTP. # # This script is automatically generated by ngrinder. # # @author admin from net.grinder.script.Grinder import grinder from net.grinder.script import Test from net.grinder.plugin.http import HTTPRequest from net.grinder.plugin.http import HTTPPluginControl from java.util import Date from HTTPClient import NVPair, Cookie, CookieModule control = HTTPPluginControl.getConnectionDefaults() # if you don't want that HTTPRequest follows the redirection, please modify the following option 0. # control.followRedirects = 1 # if you want to increase the timeout, please modify the following option. control.timeout = 6000 test1 = Test(1, "google.co.kr") request1 = HTTPRequest() # Set header datas headers = [] # Array of NVPair # Set param datas params = [] # Array of NVPair # Set cookie datas cookies = [] # Array of Cookie class TestRunner: # initlialize a thread def __init__(self): test1.record(TestRunner.__call__) grinder.statistics.delayReports=True pass def before(self): request1.headers = headers for c in cookies: CookieModule.addCookie(c, HTTPPluginControl.getThreadHTTPClientContext()) # test method def __call__(self): self.before() result = request1.GET("http://google.co.kr", params) # You get the message body using the getText() method. # if result.getText().find("HELLO WORLD") == -1 : # raise # if you want to print out log.. Don't use print keyword. Instead, use following. # grinder.logger.info("Hello World") if result.getStatusCode() == 200 : return elif result.getStatusCode() in (301, 302) : grinder.logger.warn("Warning. The response may not be correct. The response code was %d." % result.getStatusCode()) return else : raise |
Free forum by Nabble | Edit this page |