I have trouble with running scripts

View: New views
9 Messages — Rating Filter:   Alert me  

I have trouble with running scripts

by Minh Nguyet Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm newbie of using maxq, so I hope people can help me this. After recorded test, i try to run a simple script, it leads to this error:
--------------------------------------------------------------------
Test started
Testing URL: http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english
Response code: 200
Testing URL: http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1
Response code: 200
Testing URL: http://192.168.1.34/grid/index.php?i_cid=06785c8caae55d5841620404069c9713
Response code: 200
Testing URL: http://192.168.1.34/grid/index.php?i_cid=df95e21c7c7cfff7846a83e385b4a257
Response code: 200
Testing URL: http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f
Response code: 200
Traceback (innermost last):
  File "z_in_out.py", line 86, in ?
junit.framework.AssertionFailedError: Assert number 5 failed expected:<302> but was:<200>
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.failNotEquals(Assert.java:282)
        at junit.framework.Assert.assertEquals(Assert.java:64)
        at junit.framework.Assert.assertEquals (Assert.java:136)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
        at org.python.core.PyMethod.__call__(PyMethod.java )
        at org.python.core.PyObject.__call__(PyObject.java)
        at org.python.core.PyObject.invoke(PyObject.java)
        at org.python.pycode._pyx0.runTest$2(z_in_out.py:67)
        at org.python.pycode._pyx0.call_function (z_in_out.py)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at org.python.core.PyMethod.__call__(PyMethod.java)
        at org.python.core.PyObject.__call__(PyObject.java)
        at org.python.core.PyObject._jcallexc (PyObject.java)
        at org.python.core.PyObject._jcall(PyObject.java)
        at org.python.proxies.main$z_in_out$1.runTest(Unknown Source)
        at com.bitmechanic.maxq.HttpTestCase.Run(HttpTestCase.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
        at org.python.core.PyMethod.__call__(PyMethod.java)
        at org.python.core.PyObject.__call__(PyObject.java)
        at org.python.core.PyInstance.invoke(PyInstance.java)
        at org.python.pycode._pyx0.f$0(z_in_out.py:86)
        at org.python.pycode._pyx0.call_function (z_in_out.py)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyCode.call(PyCode.java)
        at org.python.core.Py.runCode(Py.java)
        at org.python.core.__builtin__.execfile_flags (__builtin__.java)
        at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
        at com.bitmechanic.maxq.Main.runTests(Main.java:211)
        at com.bitmechanic.maxq.Main.main(Main.java:143)

junit.framework.AssertionFailedError: junit.framework.AssertionFailedError: Assert number 5 failed expected:<302> but was:<200>
-------------------------------------------------------------

My java installed is Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03). I configure proxy as localhost:8090. I remember run some playback successfully before, but don't know why it doesn't work anymore.
Please some one help me this? Thank you in advance.


Rrgs. Nguyet

Re: I have trouble with running scripts

by Oliver Bock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you got

> junit.framework.AssertionFailedError: Assert number 5 failed
> expected:<302> but was:<200>

then it means that when you recorded your script a redirection (code
302) was received, but when you're playing it back then OK (code 200) is
being received.  That is, there is some difference between what the
script is doing and what you did when recording.  This might be because:

- your browser is supplying a cookie
- the site remembers that these actions have been done before and
operates differently
- the site is changing based on the browser's self-identification
- the site encodes information in the URLs it forwards you to, but those
URLs aren't being used by the scripts (e.g. something like Java struts).

Try pasting the URLs from your script directly into the browser and see
whether they work there.


  Oliver

--
Minh Nguyet Nguyen wrote:

> Hi,
> I'm newbie of using maxq, so I hope people can help me this. After
> recorded test, i try to run a simple script, it leads to this error:
> --------------------------------------------------------------------
> Test started
> Testing URL:
> http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english 
> <http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english>
> Response code: 200
> Testing URL:
> http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1 
> <http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1>
> Response code: 200
> Testing URL:
> http://192.168.1.34/grid/index.php?i_cid=06785c8caae55d5841620404069c9713
> Response code: 200
> Testing URL:
> http://192.168.1.34/grid/index.php?i_cid=df95e21c7c7cfff7846a83e385b4a257
> Response code: 200
> Testing URL:
> http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f 
> <http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f>
> Response code: 200
> Traceback (innermost last):
>   File "z_in_out.py", line 86, in ?
> junit.framework.AssertionFailedError: Assert number 5 failed
> expected:<302> but was:<200>
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.failNotEquals(Assert.java:282)
>         at junit.framework.Assert.assertEquals(Assert.java:64)
>         at junit.framework.Assert.assertEquals (Assert.java:136)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>         at org.python.core.PyMethod.__call__(PyMethod.java )
>         at org.python.core.PyObject.__call__(PyObject.java)
>         at org.python.core.PyObject.invoke(PyObject.java)
>         at org.python.pycode._pyx0.runTest$2(z_in_out.py:67)
>         at org.python.pycode._pyx0.call_function (z_in_out.py)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyFunction.__call__(PyFunction.java)
>         at org.python.core.PyMethod.__call__(PyMethod.java)
>         at org.python.core.PyObject.__call__(PyObject.java)
>         at org.python.core.PyObject._jcallexc (PyObject.java)
>         at org.python.core.PyObject._jcall(PyObject.java)
>         at org.python.proxies.main$z_in_out$1.runTest(Unknown Source)
>         at com.bitmechanic.maxq.HttpTestCase.Run(HttpTestCase.java:102)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>         at org.python.core.PyMethod.__call__(PyMethod.java)
>         at org.python.core.PyObject.__call__(PyObject.java)
>         at org.python.core.PyInstance.invoke(PyInstance.java)
>         at org.python.pycode._pyx0.f$0(z_in_out.py:86)
>         at org.python.pycode._pyx0.call_function (z_in_out.py)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyCode.call(PyCode.java)
>         at org.python.core.Py.runCode(Py.java)
>         at org.python.core.__builtin__.execfile_flags (__builtin__.java)
>         at
> org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
>         at com.bitmechanic.maxq.Main.runTests(Main.java:211)
>         at com.bitmechanic.maxq.Main.main(Main.java:143)
>
> junit.framework.AssertionFailedError:
> junit.framework.AssertionFailedError: Assert number 5 failed
> expected:<302> but was:<200>
> -------------------------------------------------------------
>
> My java installed is Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.5.0_10-b03). I configure proxy as localhost:8090. I remember
> run some playback successfully before, but don't know why it doesn't
> work anymore.
> Please some one help me this? Thank you in advance.
>
>
> Rrgs. Nguyet

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: I have trouble with running scripts

by Minh Nguyet Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you for replying, I still have problem.

I tried to test the other site with simple script and it seemed to work, but yet with my own site. Say, the test case is:
- Open address http://192.168.1.34/grid/index.php
- Then login with username and password
- Right away logout.
Script looks like this:

# definition of test class
class z(PyHttpTestCase):
    def runTest(self):
        self.msg('Test started')
        self.msg("Testing URL: %s" % self.replaceURL('''http://192.168.1.34/grid/'''))
        url = "http://192.168.1.34/grid/"
        params = None
        Validator.validateRequest(self, self.getMethod(), "get", url, params)
        self.get(url, params)
        self.msg("Response code: %s" % self.getResponseCode())
        self.assertEquals("Assert number 1 failed", 200, self.getResponseCode())
        Validator.validateResponse(self, self.getMethod(), url, params)
       
        params = [
            ('login_username', 'tester.admin'),
            ('login_password', ''),
            ('set_TO_authenticated', 'Login'),
            ('newlang', 'english'),]
        self.msg("Testing URL: %s" % self.replaceURL('''http://192.168.1.34/grid/?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english''') )
        url = "http://192.168.1.34/grid/"
        Validator.validateRequest(self, self.getMethod(), "post", url, params)
        self.post(url, params)
        self.msg("Response code: %s" % self.getResponseCode())
        self.assertEquals("Assert number 2 failed", 200, self.getResponseCode())
        Validator.validateResponse(self, self.getMethod(), url, params)
       
        params = [
            ('i_cid', 'e4d97ae450fcbeba416579b6a2839c4f'),]
        self.msg("Testing URL: %s" % self.replaceURL('''http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f''') )
        url = "http://192.168.1.34/grid/index.php"
        Validator.validateRequest(self, self.getMethod(), "get", url, params)
        self.get(url, params)
        self.msg("Response code: %s" % self.getResponseCode())
        self.assertEquals("Assert number 3 failed", 302, self.getResponseCode())
        Validator.validateResponse(self, self.getMethod(), url, params)
       
        self.msg("Testing URL: %s" % self.replaceURL('''http://192.168.1.34/grid/index.php'''))
        url = "http://192.168.1.34/grid/index.php"
        params = None
        Validator.validateRequest(self, self.getMethod(), "get", url, params)
        self.get(url, params)
        self.msg("Response code: %s" % self.getResponseCode())
        self.assertEquals("Assert number 4 failed", 200, self.getResponseCode())
        Validator.validateResponse(self, self.getMethod(), url, params)
       

    # ^^^ Insert new recordings here.  (Do not remove this line.)


# Code to load and run the test
if __name__ == 'main':
    test = z("z")
    test.Run()

  
But the test is failed (error like before: junit.framework.AssertionFailedError: junit.framework.AssertionFailedError: Assert number 3 failed expected:<302> but was:<200>
)
I also try to run three URLs, and they work. So what is the problem?


On 4/10/07, Oliver Bock <oliver@... > wrote:
If you got

> junit.framework.AssertionFailedError: Assert number 5 failed
> expected:<302> but was:<200>

then it means that when you recorded your script a redirection (code
302) was received, but when you're playing it back then OK (code 200) is
being received.  That is, there is some difference between what the
script is doing and what you did when recording.  This might be because:

- your browser is supplying a cookie
- the site remembers that these actions have been done before and
operates differently
- the site is changing based on the browser's self-identification
- the site encodes information in the URLs it forwards you to, but those
URLs aren't being used by the scripts (e.g. something like Java struts).

Try pasting the URLs from your script directly into the browser and see
whether they work there.


  Oliver

--
Minh Nguyet Nguyen wrote: > Testing URL:

> http://192.168.1.34/grid/index.php?i_cid=df95e21c7c7cfff7846a83e385b4a257
> Response code: 200
> Testing URL:
> http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f
> < http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f>
> Response code: 200
> Traceback (innermost last):
>   File "z_in_out.py", line 86, in ?
> junit.framework.AssertionFailedError : Assert number 5 failed
> expected:<302> but was:<200>
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.failNotEquals(Assert.java:282)
>         at junit.framework.Assert.assertEquals(Assert.java:64)
>         at junit.framework.Assert.assertEquals (Assert.java:136)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at

> org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>         at org.python.core.PyMethod.__call__(PyMethod.java )
>         at org.python.core.PyObject.__call__(PyObject.java )
>         at org.python.core.PyObject.invoke(PyObject.java)
>         at org.python.pycode._pyx0.runTest$2(z_in_out.py:67)
>         at org.python.pycode._pyx0.call_function (z_in_out.py)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyFunction.__call_ _(PyFunction.java)
>         at org.python.core.PyMethod.__call__(PyMethod.java)
>         at org.python.core.PyObject.__call__(PyObject.java)
>         at org.python.core.PyObject._jcallexc (PyObject.java )
>         at org.python.core.PyObject._jcall(PyObject.java)
>         at org.python.proxies.main$z_in_out$1.runTest(Unknown Source)
>         at com.bitmechanic.maxq.HttpTestCase.Run(HttpTestCase.java:102)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>         at org.python.core.PyMethod.__call_ _(PyMethod.java)
>         at org.python.core.PyObject.__call__(PyObject.java)
>         at org.python.core.PyInstance.invoke(PyInstance.java)
>         at org.python.pycode._pyx0.f$0(z_in_out.py:86)
>         at org.python.pycode._pyx0.call_function (z_in_out.py)

>         at org.python.core.PyTableCode.call(PyTableCode.java)
>         at org.python.core.PyCode.call(PyCode.java)
>         at org.python.core.Py.runCode (Py.java)
>         at org.python.core.__builtin__.execfile_flags (__builtin__.java)
>         at
> org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
>         at com.bitmechanic.maxq.Main.runTests (Main.java:211)
>         at com.bitmechanic.maxq.Main.main(Main.java:143)
>
> junit.framework.AssertionFailedError:
> junit.framework.AssertionFailedError: Assert number 5 failed
> expected:<302> but was:<200>
> -------------------------------------------------------------
>
> My java installed is Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.5.0_10-b03). I configure proxy as localhost:8090. I remember
> run some playback successfully before, but don't know why it doesn't
> work anymore.
> Please some one help me this? Thank you in advance.
>
>
> Rrgs. Nguyet

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...




--
Everywhere you'll be
Everything you'll do
In everytime
Giving me the love

Moon

Re: I have trouble with running scripts

by Oliver Bock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could it be that

> ('i_cid', 'e4d97ae450fcbeba416579b6a2839c4f')

changes each time the script is used?  In this case you'll always be
using an old identifier.


  Oliver

--
Minh Nguyet Nguyen wrote:

> Thank you for replying, I still have problem.
>
> I tried to test the other site with simple script and it seemed to
> work, but yet with my own site. Say, the test case is:
> - Open address http://192.168.1.34/grid/index.php
> - Then login with username and password
> - Right away logout.
> Script looks like this:
>
> # definition of test class
> class z(PyHttpTestCase):
>     def runTest(self):
>         self.msg('Test started')
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/''')
> <http://192.168.1.34/grid/%27%27%27%29>)
>         url = "http://192.168.1.34/grid/"
>         params = None
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 1 failed", 200,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>        
>         params = [
>             ('login_username', 'tester.admin'),
>             ('login_password', ''),
>             ('set_TO_authenticated', 'Login'),
>             ('newlang', 'english'),]
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english''')
> <http://192.168.1.34/grid/?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english%27%27%27%29>)
>         url = "http://192.168.1.34/grid/"
>         Validator.validateRequest(self, self.getMethod(), "post", url,
> params)
>         self.post(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 2 failed", 200,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>        
>         params = [
>             ('i_cid', 'e4d97ae450fcbeba416579b6a2839c4f'),]
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f''')
> <http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f%27%27%27%29>)
>         url = "http://192.168.1.34/grid/index.php"
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 3 failed", 302,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>        
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/index.php''')
> <http://192.168.1.34/grid/index.php%27%27%27%29>)
>         url = "http://192.168.1.34/grid/index.php"
>         params = None
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 4 failed", 200,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>        
>
>     # ^^^ Insert new recordings here.  (Do not remove this line.)
>
>
> # Code to load and run the test
> if __name__ == 'main':
>     test = z("z")
>     test.Run()
>
>  
> But the test is failed (error like before:
> junit.framework.AssertionFailedError:
> junit.framework.AssertionFailedError: Assert number 3 failed
> expected:<302> but was:<200>
> )
> I also try to run three URLs, and they work. So what is the problem?
>
>
> On 4/10/07, *Oliver Bock* <oliver@... <mailto:oliver@...> > wrote:
>
>     If you got
>
>     > junit.framework.AssertionFailedError: Assert number 5 failed
>     > expected:<302> but was:<200>
>
>     then it means that when you recorded your script a redirection (code
>     302) was received, but when you're playing it back then OK (code
>     200) is
>     being received.  That is, there is some difference between what the
>     script is doing and what you did when recording.  This might be
>     because:
>
>     - your browser is supplying a cookie
>     - the site remembers that these actions have been done before and
>     operates differently
>     - the site is changing based on the browser's self-identification
>     - the site encodes information in the URLs it forwards you to, but
>     those
>     URLs aren't being used by the scripts (e.g. something like Java
>     struts).
>
>     Try pasting the URLs from your script directly into the browser
>     and see
>     whether they work there.
>
>
>       Oliver
>
>     --
>     Minh Nguyet Nguyen wrote:
>     > Hi,
>     > I'm newbie of using maxq, so I hope people can help me this. After
>     > recorded test, i try to run a simple script, it leads to this
>     error:
>     > --------------------------------------------------------------------
>     > Test started
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english
>     <http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english>
>     > <
>     http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english
>     <http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english>>
>     > Response code: 200
>     > Testing URL:
>     >
>     http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1
>     <http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1>
>     > <
>     http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1
>     <http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1>>
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=06785c8caae55d5841620404069c9713
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=df95e21c7c7cfff7846a83e385b4a257
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f
>     > <
>     http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f>
>     > Response code: 200
>     > Traceback (innermost last):
>     >   File "z_in_out.py", line 86, in ?
>     > junit.framework.AssertionFailedError : Assert number 5 failed
>     > expected:<302> but was:<200>
>     >         at junit.framework.Assert.fail(Assert.java:47)
>     >         at junit.framework.Assert.failNotEquals(Assert.java:282)
>     >         at junit.framework.Assert.assertEquals(Assert.java:64)
>     >         at junit.framework.Assert.assertEquals (Assert.java:136)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>     Method)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
>     Source)
>     >         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
>     > Source)
>     >         at java.lang.reflect.Method.invoke(Unknown Source)
>     >         at
>     >
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>     >         at org.python.core.PyMethod.__call__(PyMethod.java )
>     >         at org.python.core.PyObject.__call__(PyObject.java )
>     >         at org.python.core.PyObject.invoke(PyObject.java)
>     >         at org.python.pycode._pyx0.runTest$2(z_in_out.py:67)
>     >         at org.python.pycode._pyx0.call_function (z_in_out.py)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyFunction.__call_ _(PyFunction.java)
>     >         at org.python.core.PyMethod.__call__(PyMethod.java)
>     >         at org.python.core.PyObject.__call__(PyObject.java)
>     >         at org.python.core.PyObject._jcallexc (PyObject.java )
>     >         at org.python.core.PyObject._jcall(PyObject.java)
>     >         at org.python.proxies.main$z_in_out$1.runTest(Unknown
>     Source)
>     >         at
>     com.bitmechanic.maxq.HttpTestCase.Run(HttpTestCase.java:102)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>     Method)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
>     Source)
>     >         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
>     > Source)
>     >         at java.lang.reflect.Method.invoke(Unknown Source)
>     >         at
>     >
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>     >         at org.python.core.PyMethod.__call_ _(PyMethod.java)
>     >         at org.python.core.PyObject.__call__(PyObject.java)
>     >         at org.python.core.PyInstance.invoke(PyInstance.java)
>     >         at org.python.pycode._pyx0.f$0(z_in_out.py:86)
>     >         at org.python.pycode._pyx0.call_function (z_in_out.py)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyCode.call(PyCode.java)
>     >         at org.python.core.Py.runCode (Py.java)
>     >         at org.python.core.__builtin__.execfile_flags
>     (__builtin__.java)
>     >         at
>     > org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
>     >         at com.bitmechanic.maxq.Main.runTests (Main.java:211)
>     >         at com.bitmechanic.maxq.Main.main(Main.java:143)
>     >
>     > junit.framework.AssertionFailedError:
>     > junit.framework.AssertionFailedError: Assert number 5 failed
>     > expected:<302> but was:<200>
>     > -------------------------------------------------------------
>     >
>     > My java installed is Java(TM) 2 Runtime Environment, Standard
>     Edition
>     > (build 1.5.0_10-b03). I configure proxy as localhost:8090. I
>     remember
>     > run some playback successfully before, but don't know why it doesn't
>     > work anymore.
>     > Please some one help me this? Thank you in advance.
>     >
>     >
>     > Rrgs. Nguyet
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@...
>     <mailto:users-unsubscribe@...>
>     For additional commands, e-mail: users-help@...
>     <mailto:users-help@...>
>
>
>
>
> --
> Everywhere you'll be
> Everything you'll do
> In everytime
> Giving me the love
>
> Moon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: I have trouble with running scripts

by Minh Nguyet Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, it's the same each time the script is run

On 4/10/07, Oliver Bock <oliver@...> wrote:
Could it be that

> ('i_cid', 'e4d97ae450fcbeba416579b6a2839c4f')

changes each time the script is used?  In this case you'll always be
using an old identifier.


  Oliver

--
Minh Nguyet Nguyen wrote:

> Thank you for replying, I still have problem.
>
> I tried to test the other site with simple script and it seemed to
> work, but yet with my own site. Say, the test case is:
> - Open address http://192.168.1.34/grid/index.php
> - Then login with username and password
> - Right away logout.
> Script looks like this:
>
> # definition of test class
> class z(PyHttpTestCase):
>     def runTest(self):
>         self.msg('Test started')
>         self.msg("Testing URL: %s" %
> self.replaceURL ('''http://192.168.1.34/grid/''')
> <http://192.168.1.34/grid/%27%27%27%29>)
>         url = "http://192.168.1.34/grid/"

>         params = None
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 1 failed", 200,
> self.getResponseCode ())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>
>         params = [
>             ('login_username', 'tester.admin'),
>             ('login_password', ''),
>             ('set_TO_authenticated', 'Login'),
>             ('newlang', 'english'),]
>         self.msg("Testing URL: %s" %
> self.replaceURL(''' http://192.168.1.34/grid/?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english''' )
> <http://192.168.1.34/grid/?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english%27%27%27%29 >)
>         url = "http://192.168.1.34/grid/"
>         Validator.validateRequest(self, self.getMethod(), "post", url,
> params)
>         self.post(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 2 failed", 200,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>
>         params = [
>             ('i_cid', 'e4d97ae450fcbeba416579b6a2839c4f'),]
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f''' )
> <http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f%27%27%27%29>)
>         url = " http://192.168.1.34/grid/index.php"
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 3 failed", 302,
> self.getResponseCode())
>         Validator.validateResponse (self, self.getMethod(), url, params)
>
>         self.msg("Testing URL: %s" %
> self.replaceURL('''http://192.168.1.34/grid/index.php''' )
> <http://192.168.1.34/grid/index.php%27%27%27%29>)
>         url = "http://192.168.1.34/grid/index.php "
>         params = None
>         Validator.validateRequest(self, self.getMethod(), "get", url,
> params)
>         self.get(url, params)
>         self.msg("Response code: %s" % self.getResponseCode())
>         self.assertEquals("Assert number 4 failed", 200,
> self.getResponseCode())
>         Validator.validateResponse(self, self.getMethod(), url, params)
>
>

>     # ^^^ Insert new recordings here.  (Do not remove this line.)
>
>
> # Code to load and run the test
> if __name__ == 'main':
>     test = z("z")
>     test.Run()
>
>
> But the test is failed (error like before:
> junit.framework.AssertionFailedError:
> junit.framework.AssertionFailedError: Assert number 3 failed
> expected:<302> but was:<200>
> )
> I also try to run three URLs, and they work. So what is the problem?
>
>
> On 4/10/07, *Oliver Bock* <oliver@... <mailto:oliver@...> > wrote:
>
>     If you got
>
>     > junit.framework.AssertionFailedError: Assert number 5 failed
>     > expected:<302> but was:<200>
>
>     then it means that when you recorded your script a redirection (code
>     302) was received, but when you're playing it back then OK (code
>     200) is
>     being received.  That is, there is some difference between what the
>     script is doing and what you did when recording.  This might be
>     because:
>
>     - your browser is supplying a cookie
>     - the site remembers that these actions have been done before and
>     operates differently
>     - the site is changing based on the browser's self-identification
>     - the site encodes information in the URLs it forwards you to, but
>     those
>     URLs aren't being used by the scripts (e.g. something like Java
>     struts).
>
>     Try pasting the URLs from your script directly into the browser
>     and see
>     whether they work there.
>
>
>       Oliver
>
>     --
>     Minh Nguyet Nguyen wrote:
>     > Hi,
>     > I'm newbie of using maxq, so I hope people can help me this. After
>     > recorded test, i try to run a simple script, it leads to this
>     error:
>     > --------------------------------------------------------------------
>     > Test started
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english
>     <http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english >
>     > <
>     http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english
>     <http://192.168.1.34/grid/index.php?login_username=tester.admin&login_password=&set_TO_authenticated=Login&newlang=english >>
>     > Response code: 200
>     > Testing URL:
>     >
>     http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1
>     < http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1>
>     > <
>     http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1

>     <http://sb.google.com/safebrowsing/update?client=Firefox2.0&mozver=1.8.1-0000000000&version=goog-white-domain:1:20,goog-white-url:1:371,goog-black-url:1:9784,goog-black-enchash:1:-1 >>
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=06785c8caae55d5841620404069c9713
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=df95e21c7c7cfff7846a83e385b4a257
>     > Response code: 200
>     > Testing URL:
>     >
>     http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f
>     > <
>     http://192.168.1.34/grid/index.php?i_cid=e4d97ae450fcbeba416579b6a2839c4f>
>     > Response code: 200
>     > Traceback (innermost last):
>     >   File "z_in_out.py", line 86, in ?
>     > junit.framework.AssertionFailedError : Assert number 5 failed
>     > expected:<302> but was:<200>
>     >         at junit.framework.Assert.fail(Assert.java:47)
>     >         at junit.framework.Assert.failNotEquals(Assert.java:282)
>     >         at junit.framework.Assert.assertEquals(Assert.java :64)
>     >         at junit.framework.Assert.assertEquals (Assert.java:136)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>     Method)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown
>     Source)
>     >         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
>     > Source)
>     >         at java.lang.reflect.Method.invoke(Unknown Source)
>     >         at
>     >
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>     >         at org.python.core.PyMethod.__call__(PyMethod.java )
>     >         at org.python.core.PyObject.__call_ _(PyObject.java )
>     >         at org.python.core.PyObject.invoke(PyObject.java)
>     >         at org.python.pycode._pyx0.runTest$2(z_in_out.py:67)
>     >         at org.python.pycode._pyx0.call_function (z_in_out.py)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyTableCode.call (PyTableCode.java)
>     >         at org.python.core.PyFunction.__call_ _(PyFunction.java)
>     >         at org.python.core.PyMethod.__call__(PyMethod.java)
>     >         at org.python.core.PyObject.__call_ _(PyObject.java)
>     >         at org.python.core.PyObject._jcallexc (PyObject.java )
>     >         at org.python.core.PyObject._jcall(PyObject.java)
>     >         at org.python.proxies.main$z_in_out$1.runTest (Unknown
>     Source)
>     >         at
>     com.bitmechanic.maxq.HttpTestCase.Run(HttpTestCase.java:102)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>     Method)
>     >         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
>     Source)
>     >         at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown
>     > Source)
>     >         at java.lang.reflect.Method.invoke(Unknown Source)
>     >         at
>     >
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
>     >         at org.python.core.PyMethod.__call _ _(PyMethod.java)
>     >         at org.python.core.PyObject.__call__(PyObject.java)
>     >         at org.python.core.PyInstance.invoke(PyInstance.java)
>     >         at org.python.pycode._pyx0.f$0 (z_in_out.py:86)
>     >         at org.python.pycode._pyx0.call_function (z_in_out.py)
>     >         at org.python.core.PyTableCode.call(PyTableCode.java)
>     >         at org.python.core.PyCode.call (PyCode.java)
>     >         at org.python.core.Py.runCode (Py.java)
>     >         at org.python.core.__builtin__.execfile_flags
>     (__builtin__.java)
>     >         at
>     > org.python.util.PythonInterpreter.execfile(PythonInterpreter.java)
>     >         at com.bitmechanic.maxq.Main.runTests (Main.java:211)
>     >         at com.bitmechanic.maxq.Main.main(Main.java:143)
>     >

>     > junit.framework.AssertionFailedError:
>     > junit.framework.AssertionFailedError: Assert number 5 failed
>     > expected:<302> but was:<200>
>     > -------------------------------------------------------------
>     >
>     > My java installed is Java(TM) 2 Runtime Environment, Standard
>     Edition
>     > (build 1.5.0_10-b03). I configure proxy as localhost:8090. I
>     remember
>     > run some playback successfully before, but don't know why it doesn't
>     > work anymore.
>     > Please some one help me this? Thank you in advance.
>     >
>     >
>     > Rrgs. Nguyet
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@...
>     <mailto:users-unsubscribe@...>
>     For additional commands, e-mail: users-help@...
>     <mailto:users-help@...>
>
>
>
>---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: I have trouble with running scripts

by Oliver Bock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think you'll have to ask whoever maintains the site why it's not
returning a redirection in this case.


   Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: I have trouble with running scripts

by Minh Nguyet Nguyen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think maybe I did something wrong when tested. I tried to use a test case with other site:
- Open www.google.com.vn
- Search for "yahoo mail"
- Go to yahoo mail page by clicking on result
- Login and logout.

This test case is failed for me too. So I wonder If I have to do something before running test like: clear cookies, caches...? Actually I tried to clear cookies but It didn't work.

On 4/10/07, Oliver Bock <oliver@...> wrote:
I think you'll have to ask whoever maintains the site why it's not
returning a redirection in this case.


   Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: I have trouble with running scripts

by Oliver Bock :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Google doesn't like bots so you cannot use it for testing.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: I have trouble with running scripts

by