I have a problem on creating script

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

I have a problem on creating script

Shin kyoungmin
Hi Guys (and Girls?)

I just install nGrinder to TEST our modules on Web

A problem happened

I call ....

아 한국말로 하면 안되나요?
can I write in Korean TT?

anyway, I called specific URL by POST method
but POST data is too long

example,

---------------------------------------------------------------------------------------
test1 = Test(1, "Test1")
request1 = HTTPRequest(url="[specific URL]")

class TestRunner:
        def __call__(self):
                grinder.statistics.delayReports=True
               
                parameter = (
                        NVPair("testdata","[too long over 32767 characters over]"),
                )
               
                result = request1.POST(parameter)

                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0

----------------------------------------------------------------------------------------------

example script get SyntaxError:

 net.grinder.scriptengine.jython.JythonScriptExecutionException: SyntaxError: ('string constant too large (more than 32767 characters)', ('[specific navigation]', 22, 40, ''))

How Can I put in testdata by "[too long over 32767 characters over]"

Help me, plz TT

휴 일단 영어로는 다썻고 혹시 한국인이실걸 대비해서 한국말로 부연설명을 좀 하자면
포스트 방식으로 데이터를 좀 긴걸로 넘기려고 하는데 Jython 문자열데이터 길이 한계상 32767글자이상 못넣는데요
이걸 우회하려면 어떻게 해야 하는지 잘 모르겠네요 파일에서 읽어서 post로 스트림을 넘겨주면 해준다던지 등등의 방법이 있으시면 좀 알려 주세용 (굽신굽신)
Reply | Threaded
Open this post in threaded view
|

RE: I have a problem on creating script

junoyoon
Administrator

Hi. There!  


I'm Korean speaker.. but.. we're aiming to global market.. so please understand..

I think you can use resource to load such a big data.

What I mean...

Please create resources folder just below the script is located.

and upload the text file you want.

and read it like..

file    = open("./resources/sellerID.txt", "r")

you can use read / write python operation. and just load them with above method..


that resources file will be transfered agents.


JunHo Yoon
Global Platform Development Lab
/ Senior Engineer

13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA
Tel 031-600-9071   Fax --   Mobile 010-6255-0559
Email  [hidden email]

NHN Business & Platform NAVER HANGAME 쥬니어네이버 해피빈 미투데이


-----Original Message-----
From: "Shin kyoungmin [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2012-12-12 (수) 17:55:47
Subject: I have a problem on creating script

Hi Guys (and Girls?)

I just install nGrinder to TEST our modules on Web

A problem happened

I call ....

아 한국말로 하면 안되나요?
can I write in Korean TT?

anyway, I called specific URL by POST method
but POST data is too long

example,

---------------------------------------------------------------------------------------
test1 = Test(1, "Test1")
request1 = HTTPRequest(url="[specific URL]")

class TestRunner:
        def __call__(self):
                grinder.statistics.delayReports=True
               
                parameter = (
                        NVPair("testdata","[too long over 32767 characters over]"),
                )
               
                result = request1.POST(parameter)

                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0

----------------------------------------------------------------------------------------------

example script get SyntaxError:

 net.grinder.scriptengine.jython.JythonScriptExecutionException: SyntaxError: ('string constant too large (more than 32767 characters)', ('[specific navigation]', 22, 40, ''))

How Can I put in testdata by "[too long over 32767 characters over]"

Help me, plz TT

휴 일단 영어로는 다썻고 혹시 한국인이실걸 대비해서 한국말로 부연설명을 좀 하자면
포스트 방식으로 데이터를 좀 긴걸로 넘기려고 하는데 Jython 문자열데이터 길이 한계상 32767글자이상 못넣는데요
이걸 우회하려면 어떻게 해야 하는지 잘 모르겠네요 파일에서 읽어서 post로 스트림을 넘겨주면 해준다던지 등등의 방법이 있으시면 좀 알려 주세용 (굽신굽신)


If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/I-have-a-problem-on-creating-script-tp81.html
To start a new topic under ngrinder-user, email [hidden email]
To unsubscribe from ngrinder-user, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

RE: I have a problem on creating script

Shin kyoungmin
I solved the problem
thanks to you

I'll study Python for using nGrinder TT

for korean

http://jythonbook_ko.readthedocs.org 

will be good

thank you

code
--------------------------------------------------------------------------------
test1 = Test(1, "Test1")
request1 = HTTPRequest(url="[specified URL]")
file = open("[specified navigation]","r")

class TestRunner:
        def __call__(self):
                grinder.statistics.delayReports=True
               
                parameter = (
                        NVPair("excel",file.read()),
                )
               
                result = request1.POST(parameter)
               
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0

---------------------------------------------------------------------------------