tclwebtest-general Mailing List for tclwebtest (Page 7)
Status: Abandoned
Brought to you by:
tils
This list is closed, nobody may subscribe to it.
2003 |
Jan
(31) |
Feb
(61) |
Mar
(34) |
Apr
(2) |
May
(3) |
Jun
(2) |
Jul
(11) |
Aug
(17) |
Sep
(8) |
Oct
(7) |
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(2) |
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
(1) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Tilmann S. <ti...@ti...> - 2003-02-15 11:17:45
|
Is your cambios-tclwebtest-2003-01-27b patch the latest one regarding the issue of avoiding the usage of temporary files? The approach I took with the temporary files looks like a huge hack to me and it would be greatly appreciated if you'd remove that. I remember that it seemed necessary in order to be able to retrieve the _comment_ lines immediately before the command that failed, which looks like an unnecessary requirement to me now. We should consider introducing a better way to include msg-if-next-command-fails in the tests. One way would be to include a parameter for each of the commands that can cause a test failure. I think that is the standard testing framework approach. Another idea would be to add a command like msg that takes one string as argument, which will be saved internally and only output if a following command produces a failure. To reset the fail_msg one would simply call it with no arguments or an empty string. A test could thus look like this: msg { Logging in } do_request $some_url link follow "login" field fill $password form submit msg Or it could optionally wrap the code in a block so that the message is only valid for that block: msg { Logging in } { do_request $some_url link follow "login" field fill $password form submit } What is your opinion on the best syntax? We might also introduce a common test declaration command along with it which could come at the top of each file and which would make use of the api doc generator, like this: twt_test login { This test logs in to the website using the standard password. @author til } do_request ... There are propably better names for these and maybe more that could be learnt from other testing frameworks, but why I actually wrote it is to say that the current requirement to be able to read the tcl comments from the test source code is not really important, so don't jump through big loops to preserve it when modifying tclwebtest to use strings instead of temporary files, and please commit your patch with these modifications, if not already done. cheers, Til |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 11:01:17
|
On Sat, Feb 15, 2003 at 10:47:23AM +0000, Tilmann Singer wrote: > > I've found out that log is a nice command to use along with assert, > > since assert is silent when it succeeds, it may be good to move it > > to the public api. > > Please do so! ;) Done. Index: lib/tclwebtest.tcl =================================================================== RCS file: /cvsroot/tclwebtest/tclwebtest/lib/tclwebtest.tcl,v retrieving revision 1.24 diff -u -r1.24 tclwebtest.tcl --- lib/tclwebtest.tcl 15 Feb 2003 10:53:00 -0000 1.24 +++ lib/tclwebtest.tcl 15 Feb 2003 11:00:27 -0000 @@ -217,7 +217,14 @@ } -proc log msg { +ad_proc -public log { + msg +} { + + Adds msg to the output log. + +} { + variable log_channel if { ![info exists log_channel] || $log_channel == "" } { -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Tilmann S. <ti...@ti...> - 2003-02-15 10:53:58
|
* Grzegorz Adam Hankiewicz <gr...@ef...> [20030127 16:13]: > I've found out that log is a nice command to use along with assert, > since assert is silent when it succeeds, it may be good to move it > to the public api. Please do so! ;) cheers, Til |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 10:53:42
|
> > Since I expect "link find" and related to search in plain text, > > the solution is quite simple: stripping the html when retrieving > > the links. > > I also think it should search in the text only, stripped from > html. Please commit that fix as well, thanks! Done. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 10:50:09
|
The following script crashes tclwebtest: do_request http://barrapunto.com/users.pl?op=preferences form find Entrar field fill my_nick field fill my_pass If I put a "field current" after "form find", it seems to work. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 10:46:49
|
> > This patch replaces the previously broken patch adding the feature > > of changing the user agent identification from user scripts through > > a defined interface. > > Please commit it if you haven't done already. Done. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Tilmann S. <ti...@ti...> - 2003-02-15 10:45:58
|
* Grzegorz Adam Hankiewicz <gr...@ef...> [20030212 18:27]: > If you try with your text editor to search the word "topics" in > that log, you will find out that the search was done correctly, > and it was the html img code containing the word topics which > triggered the false hit. Since I expect "link find" and related > to search in plain text, the solution is quite simple: stripping > the html when retrieving the links. I also think it should search in the text only, stripped from html. Please commit that fix as well, thanks! til |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 10:44:05
|
> > Approval request to commit the following patch. It adds form get > > support and a little bit of documentation with embedded example. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Tilmann S. <ti...@ti...> - 2003-02-15 10:37:45
|
* Grzegorz Adam Hankiewicz <gr...@ef...> [20030215 09:29]: > Approval request to commit the following patch. It adds form get > support and a little bit of documentation with embedded example. The > patch separates the logic from implementation during the do_request > build time using function pointers. Go ahead please and commit that! ;) til |
From: Tilmann S. <ti...@ti...> - 2003-02-15 10:32:17
|
* Grzegorz Adam Hankiewicz <gr...@ef...> [20030215 10:02]: > This patch replaces the previously broken patch adding the feature > of changing the user agent identification from user scripts through > a defined interface. Please commit it if you haven't done already. Thanks, Til -- http://tsinger.com |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 10:01:22
|
This patch replaces the previously broken patch adding the feature of changing the user agent identification from user scripts through a defined interface. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 09:28:48
|
Approval request to commit the following patch. It adds form get support and a little bit of documentation with embedded example. The patch separates the logic from implementation during the do_request build time using function pointers. The behaviour of forms is a little bit changed: the submit button is always sent, but only the selected one (first found being default), and unchecked checkboxes aren't sent, which triggered a strange post error in a web page of our intranet, and which seems to be the behaviour of real life browsers. According to my tests these slight changes shouldn't break anything already working. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 08:24:03
|
On Fri, Feb 07, 2003 at 12:49:38PM +0100, Grzegorz Adam Hankiewicz wrote: > The attached patch implements a new procedure which allows changing > the user agent string, hence forcing Google to return 200 http code. Patch rejected, improved version will follow. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-15 08:23:37
|
On Thu, Feb 06, 2003 at 12:00:43PM +0100, Grzegorz Adam Hankiewicz wrote: > After being able to browse google with the previous cookie patch, > I was unable to use their forms because they use get method. The > following patch adds support for this. Patch rejected, improved version will follow. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-12 18:26:38
|
On Wed, Jan 29, 2003 at 06:17:40PM +0100, Grzegorz Adam Hankiewicz wrote: > Hi. > > Looks like the absence of a selftest for "link follow ~c" has let > this bug survive, the search is done in the full html instead of > just the content. > [...] > --- do_request for http://slashdot.org/ > http status: >>200<< > <A HREF="//slashdot.org/search.pl?topic=126"><IMG > SRC="//images.slashdot.org/topics/topictech2.gif" > WIDTH="60" HEIGHT="80" > BORDER="0" ALT="Technology"></A> > --- do_request for http://slashdot.org//slashdot.org/search.pl?topic=126 > [...] > link find ~c "topics" > log [link get_full] > [...] Oh, this was a wrong analysis on my part. tclwebtest correctly searches for the content of all available links. The problem is that when I wrote that script, searching for the "topics" link, and the found hyperlink contained the word "topic", I thought the search was being done on the raw html of the hyperlink. If you try with your text editor to search the word "topics" in that log, you will find out that the search was done correctly, and it was the html img code containing the word topics which triggered the false hit. Since I expect "link find" and related to search in plain text, the solution is quite simple: stripping the html when retrieving the links. Index: lib/tclwebtest.tcl =================================================================== RCS file: /cvsroot/tclwebtest/tclwebtest/lib/tclwebtest.tcl,v retrieving revision 1.20 diff -u -r1.20 tclwebtest.tcl --- lib/tclwebtest.tcl 12 Feb 2003 16:59:57 -0000 1.20 +++ lib/tclwebtest.tcl 12 Feb 2003 18:14:16 -0000 @@ -2146,7 +2146,7 @@ # this is way too simple regexp -nocase {>(.*)<} $a_link(full) match a_link(content) - set a_link(content) [normalize_html $a_link(content)] + set a_link(content) [util_remove_html_tags [normalize_html $a_link(content)]] lappend ::tclwebtest::links [array get a_link] This patch makes my script work as I expected, but maybe this is not the exact behaviour tclwebtest should have. What do you think about it? After all, if somebody is searching for exact html code, the use of 'link find ~f xxx' should be good enough. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-11 17:50:21
|
On Thu, Jan 30, 2003 at 07:25:16PM +0100, Grzegorz Adam Hankiewicz wrote: > [...] The peculiar reason for computing the commands for eval > as a list are explained in a book about tcl I have right here, > which says that using double quotes is bad because structure is > lost. More importantly, my previous grief with a void redirection > is now worse [...] Patch rejected, it didn't address the real problem which was correctly treating void location field after a chain of 302 redirections. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-11 17:41:20
|
On Thu, Jan 30, 2003 at 05:51:24PM +0100, Grzegorz Adam Hankiewicz wrote: > How should I deal with this? I presume this blank redirection > AOLServer sends means that the browser should return to the > original url before the redirections started, but looks a very > awkward behaviour. Maybe this would require a "history" variable > in tclwebtest? Looks like it doesn't. Again, here's a script which fails due to null redirection: > do_request http://www.efaber.net/prensa > link follow {English} And here's the output > ----- START: ../cusfalla1.txt at [11/feb/2003:18:33:10] ----- > --- do_request for http://www.efaber.net/prensa > http status: >>200<< > --- do_request for http://www.efaber.net/language-prefs.tcl?language_preference=en > http status: >>302<< > following a redirect to: http://www.efaber.net/cookie-chain.tcl?cookie_name=language_preference&cookie_value=en&final_page=&expire_state=p > --- do_request for http://www.efaber.net/cookie-chain.tcl?cookie_name=language_preference&cookie_value=en&final_page=&expire_state=p > http status: >>302<< > following a redirect to: > > No value specified for argument url > while executing > "do_request__arg_parser" > blah blah blah I tested the same page with elinks simulating tclwebtest after desactivating elinks' referer http feature: > CONNECTION: www.efaber.net > GET /prensa HTTP/1.1 > HTTP/1.0 200 OK > > GET /language-prefs.tcl?language_preference=es HTTP/1.1 > HTTP/1.0 302 Found > Location: http://www.efaber.net/cookie-chain.tcl?cookie_name=language_preference&cookie_value=es&final_page=&expire_state=p > > GET /cookie-chain.tcl?cookie_name=language_preference&cookie_value=es&final_page=&expire_state=p HTTP/1.1 > HTTP/1.0 302 Found > Set-Cookie: language_preference=es; path=/; expires=Fri, 01-Jan-2010 01:00:00 GMT > Location: > > GET / HTTP/1.1 > Cookie: language_preference=es > HTTP/1.0 200 OK Which could mean that after a null redirection the browser has to get the root directory. However, I tested this also against another page doing this trick: > do_request http://borja.casa-sotomayor.net/ > link follow {text-only} Output: > ----- START: ../cusfalla2.txt at [11/feb/2003:18:36:17] ----- > --- do_request for http://borja.casa-sotomayor.net/ > http status: >>200<< > Enlaces modo gráfico 63 > --- do_request for http://borja.casa-sotomayor.net/methods/setMode?mode=text > http status: >>302<< > following a redirect to: > > No value specified for argument url > while executing > "do_request__arg_parser" > blah blah Surprisingly this is elink's behaviour: > CONNECTION: borja.casa-sotomayor.net > GET / HTTP/1.1 > ... > HTTP/1.1 200 OK > > GET /methods/setMode?mode=text HTTP/1.1 > HTTP/1.1 302 Moved Temporarily > Location: > Set-Cookie: BORJANET_MODE="text"; Path=/ > > GET /methods/ HTTP/1.1 > Cookie: BORJANET_MODE="text" > HTTP/1.1 302 Moved Temporarily > Location: / This means that whenever a null location is sent to the browser with a 302 redirection, the browser then requests the same path without file component. Hence, this patch makes all the above tested web pages work, because after all the redirections the cookie has been set and all is ok: Index: lib/tclwebtest.tcl =================================================================== RCS file: /cvsroot/tclwebtest/tclwebtest/lib/tclwebtest.tcl,v retrieving revision 1.17 diff -u -r1.17 tclwebtest.tcl --- lib/tclwebtest.tcl 10 Feb 2003 09:26:46 -0000 1.17 +++ lib/tclwebtest.tcl 11 Feb 2003 17:23:40 -0000 @@ -1797,9 +1797,13 @@ if { $http_status == "302" || $http_status == "301" } { for { set i 0 } { $i < [llength $meta] } { incr i 2 } { if { [string match -nocase [lindex $meta $i] "location"] } { - set location [lindex $meta [expr $i+1]] + set location [string trim [lindex $meta [expr $i+1]]] break } + } + if { $location == "" } { + # when location is null after redirection, get relative directory + set location "./" } if { $http_status == "301" } { if $nocomplain_p { Patch commited, because it fixes the infinite loop problem I was facing. Improved output example (which replicates elinks behaviour): ----- START: ../cusfalla2.txt at [11/feb/2003:18:42:00] ----- --- do_request for http://borja.casa-sotomayor.net/ http status: >>200<< --- do_request for http://borja.casa-sotomayor.net/methods/setMode?mode=text http status: >>302<< following a redirect to: ./ --- do_request for http://borja.casa-sotomayor.net/methods/./ http status: >>302<< following a redirect to: / --- do_request for http://borja.casa-sotomayor.net/ http status: >>200<< ----- SUCCESS: ../cusfalla2.txt (took 15s) ----- PD: While this is good and nice for me (because these webs start to work), it would be nice if you could check some "official" page describing the correct browser behaviour in such cases. Unluckily I didn't google anything useful. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 09:29:18
|
On Thu, Feb 06, 2003 at 12:38:41PM +0100, Grzegorz Adam Hankiewicz wrote: > This patch allows following 301 redirections with -nocomplain, > otherwise assertion_failed is called. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 09:19:12
|
On Fri, Jan 31, 2003 at 12:35:56PM +0100, Grzegorz Adam Hankiewicz wrote: > This patch fixes the incorrect relative url construction with web > pages like http://slashdot.org/. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 09:12:29
|
On Fri, Jan 24, 2003 at 02:29:04PM +0000, Tilmann Singer wrote: > Try to replace $nocomplain with $nocomplain_p within the do_request > proc and tell me if that works. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 09:06:06
|
On Wed, Feb 05, 2003 at 03:59:21PM +0100, Grzegorz Adam Hankiewicz wrote: > > > But tclwebtest fails with a really funny cookie error: > > Patch attached, it works with google and hotmail. Commited. > However, hotmail still seems to have a problem with cookies: This persists, I suspect it's a problem with the 'referer' value sent by tclwebtest, but I will track this down later. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 08:54:53
|
On Wed, Jan 29, 2003 at 06:02:52PM +0100, Grzegorz Adam Hankiewicz wrote: > This may not be obvious, but applies over the description of > "link follow". Commited after some rewording. + Note that after this command you can get the current URL with + <a href="#response_url">response url</a>, useful if you followed a + link by text and you want to store/verify the url tclwebtest chose. + -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 08:46:35
|
On Tue, Jan 28, 2003 at 07:06:05PM +0100, Grzegorz Adam Hankiewicz wrote: > One is to be applied on tclwebtest.tcl, another over a selftest. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |
From: Grzegorz A. H. <gr...@ef...> - 2003-02-10 08:28:58
|
On Thu, Jan 30, 2003 at 06:32:19PM +0100, Grzegorz Adam Hankiewicz wrote: > The following patch fixes the incorrect use of the followequiv > variable and adds another character to the regular expresion > detecting stupid broken redirections. Commited. -- Grzegorz Adam Hankiewicz, gr...@ef.... Tel: +34-94-472 35 89. eFaber SL, Maria Diaz de Haro, 68, 2 http://www.efaber.net/ 48920 Portugalete, Bizkaia (SPAIN) |