[ptt-users] Enable redirect in TestMaker functional tests
DGeorgie at wiley.com
DGeorgie at wiley.com
Wed Mar 12 06:52:51 PST 2008
Hi William,
Sorry if my response was confusing. I think I understood what that message
said. The fact is that I cannot run tg4w script directly from TestMaker if
HTTP redirects are present. The redirect warning messages submitted in my
first posting were from TestMaker trying to execute my tg4w script.
You probably have seen my subsequent emails on this list. I tried to run
the generated Java program directly from the command line and from
TestMaker.. Both attempts were unsuccessful. I will need to get more
familiar with the Java libraries before I can continue in this direction.
Today I tried different approach. I used the Proxy recorder to generate a
Jython script for my test. The result was very disappointing. The
generated script blindly submits the Java session id to the server which
naturally is expired and the ends up again on the log-in page. The script
makes no effort even to verify whether it lads the correct page and
continues to submit the request one after the other hitting the logging
page over and over.
I was hoping Test Maker will shorten my time to create and deploy a
functional test script with no or minimal code modifications of the
generated code. Now I think it is just easier and probably much faster for
me to implement the whole test script from scratch using Perl modules that
provide similar functionality but are much easier to maintain and run.
Probably I could do the same thing with Jython but I don't see the point
of using an obscure scripting language, which none of the admins here,
would be willing to learn to maintain the testing scripts.
Thanks,
Dimitar Georgievski
William Martinez Pomares <wmartinez at AVANTICATEC.NET>
Sent by: users-bounces at lists.pushtotest.com
03/12/2008 10:01 AM
Please respond to
TestMaker users list <users at lists.pushtotest.com>
To
"TestMaker users list" <users at lists.pushtotest.com>
cc
Subject
RE: [ptt-users] Enable redirect in TestMaker functional tests
Hi Dimitar.
No, that is not what the message from HTMLUnit says.
The guy from HTMLUnit uses HTTPUnit to perform the HTTP work. But for
some reason, he disables HTTPUnit redirection and handles redirection
manually in HTMLUnit, one layer above. The problem he faces is that
HTTPUnit throws that warning and he does not know how to avoid it. The
redirection is done in HTMLUnit, but HTTPUnit throws the warning since
it does not know about it. So, there is no problem with redirecting,
just an annoying message from an underlying module.
Thus, your don't need to change Java Code. Actually, you can run the
TG4W script using langtype ="tg4w" without needing to geenrate java nor
jython code.
Hope this clarifies.
Regards,
William Martinez
-----Original Message-----
From: users-bounces at lists.pushtotest.com
[mailto:users-bounces at lists.pushtotest.com]On Behalf Of
DGeorgie at wiley.com
Sent: Tuesday, March 11, 2008 8:17 PM
To: TestMaker users list
Subject: RE: [ptt-users] Enable redirect in TestMaker functional tests
Hi William,
If I understood correctly I will need to modify the generated Java code
to
enable the HTTP redirect and then create another test scenario with
TestMaker to run the Java code. How do I enable the HTTP redirect in the
Java code? I am still researching the documentation and not sure how to
enable it.
Too bad HTMLUnit is not supporting redirects. It makes simple tests
difficult,
Thanks,
Dimitar Georgievski
William Martinez Pomares <wmartinez at AVANTICATEC.NET>
Sent by: users-bounces at lists.pushtotest.com
03/11/2008 06:26 PM
Please respond to
TestMaker users list <users at lists.pushtotest.com>
To
"TestMaker users list" <users at lists.pushtotest.com>
cc
Subject
RE: [ptt-users] Enable redirect in TestMaker functional tests
Hi Dimitar.
This is interesting.
TG4W is a tool to record the steps of your interactions. When replayed
in the browser, the tool is using the actual browser actions to repeat
the steps.
When used outside the browsers, TG4W uses the HTMLUnit product to replay
the steps. HTMLUnit is a testing product that executes all the common
browser actions without a IU. Internally, it uses another tool called
httpclient from apache commons.
So, when used in TM, it actually calls the HTMLUnit to perform all the
recorded steps smulating a browser. Using a Jython or Java generated
from the TG4W script will allow you to see all the steps and customize
the calls to HTMLUnit.
That error you see there, it seems, is a message in the HTMLUnit module
but not an error. See what it is said about that in the HTMLUnit site:
" I get error messages about redirection being disabled but I've turned
it on.
26.02.2003 16:07:05 org.apache.commons.httpclient.HttpMethodBase
processRedirectResponse
INFO: Redirect requested but followRedirects is disabled
It's an annoyance that I haven't figured out how to fix yet.
For a variety of reasons, I handle the redirection logic inside
HtmlUnit rather than letting commons-httpclient handle it for me. It's
commons-httpclient that is displaying that message because I have
explicitly disabled its redirection support.
I'd like to filter out that warning message but haven't figured out
a clean way of doing it. A number of people have pointed out that it's
easy to disable a message if you know which logger is being used. The
problem is that there isn't a way to disable the messages without
knowing the logger in use. "
http://htmlunit.sourceforge.net/faq.html#RedirectionDiagnosticMessages
So, it seems that message is not an error, but a unhandled warning from
HTMLUnit guys.
Furthermore. If TG4W fails, it will show the error and the trace.
So, it seems there is yet no way to eliminate the message, but it also
seems the steps are being correctly executed.
Now, about the generation error: Could you please tell me what was the
error when generating?
Was it generating or running the generated asset?
If you generated Jython, it will automatically work without any other
setup (Jython is interpreted).
If you generated Java, you will need to compile the java and pack it
into a jar. In the TestScenario you will need to use the <jar > tag to
indicate where the java jar is to be found. You can follow the
"counterDPLExample".
<resources>
<jar
path="./example_agents/counterDPLExample/print.jar"/>
</resources>
<run name="CVS" testclass="com.examples.print"
method="print"
langtype="java">
If you need more help please let me know.
William Martinez
-----Original Message-----
From: users-bounces at lists.pushtotest.com
[mailto:users-bounces at lists.pushtotest.com]On Behalf Of
DGeorgie at wiley.com
Sent: Tuesday, March 11, 2008 1:00 PM
To: users at lists.pushtotest.com
Subject: [ptt-users] Enable redirect in TestMaker functional tests
I have problem with a functional test. When the script runs it generates
these errors in the TestNode output.
Executing time 0
TestRunListeners
TestIndex
Test #1/1 : ./localhost/ProfLogin_loop2.tg4w
- Redirect requested but followRedirects is disabled
- Redirect requested but followRedirects is disabled
- Redirect requested but followRedirects is disabled
The functional test was created based on a script generated by
TestGen4Web
0.50.2. I am using TestMaker 5.1 on Fedora 8 and Java 6 build 3.
The TestGen4Web script executes correctly in FireFox browser.
I have found in TG4W forums other people with the same problem but no
solution for the problem. I couldn't find any TestMaker setting that
could
affect the Redirect behavior which is really strange because I am sure
most of modern Web applications are using redirects extensively. Without
a
support for it any testing tool would be useless.
I also converted the TG4W script to a Java program hoping I would be
able
to tweak the Java code and enable the HTTP redirects. BTW the Jython
translation didn't work.
The generated code has a class which executes the test.
InterpreterContext context = new InterpreterContext(this.config);
I am still trying to find a documentation for this class. I need help
with
two things here:
1) how to correctly set -up the classpath to compile and execute the
Java
program
2) how to enable the HTTP redirects in the Java program.
Thanks in advance!
Dimitar
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users
_______________________________________________
Users mailing list
Users at lists.pushtotest.com
http://lists.pushtotest.com/mailman/listinfo/users
More information about the Users
mailing list