kron filter | 24 Apr 2010 21:37
Picon
Favicon

Twill Scripting Limitations?


We need to perform a number of synthetic transactions. 

 

I
don't know if I just fail at using Twill or what but I'm having a great
deal of difficulty with the first two pages I'm trying to create
scripts for.

 

Example 1:

 

www.blah.com
pops up a disclaimer when first visited in a browser.  Hit OK to force
disclaimer to go away.  There is a userID field, password field and
domain selection field with a dropdown of 10 or so domains.  There is a
single submission button on the page.

 

Script looks like this:

 

go www.blah.com
fv 3 in_tx_username whoamI
fv 3 in_pw_userpass idunno!
fv 3 in_domain DOMAIN
submit

 

 

After
submitting, another showforms shows you the same forms and you have not
been forwarded to the "home page" as you would have been forwarded to
if you'd used a browser.  If you try to go www.blah.com/homepage - it
says that you're there but a showforms reveals the same forms on the
initial www.blah.com page, which are not correct, meaning you haven't
actually authenticated successfully.

 

Example 2:

 

A
synthetic transaction against a Sharepoint page.  Upon trying to visit
the webpage in a browser, you're presented with a Window'd login box. 
Is there any way for twill to actually respond to that?  Trying to
visit the webpage via twill results in a timeout. Perhaps this is where
the authentication realms come into play but I've not been able to
succeed in using them.

 

Thanks.
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.
_______________________________________________
twill mailing list
twill@...
http://lists.idyll.org/listinfo/twill
kron filter | 24 Apr 2010 23:11
Picon
Favicon

Re: Twill Scripting Limitations?

The doLogin() function that the "in_bu_Login" of type button (JavaScript) is trying to execute is as follows:
 
function doLogin() { var persistInfo = true; var cb = getRememberCheckbox(); if (!persistInfo || !cb || !cb.checked) { deleteLoginInfo(); } else { var userName = ''; var usr = getUserTextbox(); if (usr) { userName = usr.value; } var authSource = 0; var sel = getAutoSourceSelect(); if (sel) { authSource = sel.selectedIndex; } storeLoginInfo(userName,authSource); } var loginForm = document.lform; var hiddenLogin = loginForm.in_hi_dologin; hiddenLogin.value = 'true'; loginForm.submit(); }  
 
From the looks of it, this step isn't actually taking place.. nor do I know how I'd replicate this in Python.

 
From: kronfilter-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
To: twill-zFNWeKVCUJJD5a/XDn3G2A@public.gmane.org
Date: Sat, 24 Apr 2010 19:37:57 +0000
Subject: [twill] Twill Scripting Limitations?

.ExternalClass .ecxhmmessage P {padding:0px;} .ExternalClass body.ecxhmmessage {font-size:10pt;font-family:Verdana;}
We need to perform a number of synthetic transactions. 

 

I
don't know if I just fail at using Twill or what but I'm having a great
deal of difficulty with the first two pages I'm trying to create
scripts for.

 

Example 1:

 

www.blah.com
pops up a disclaimer when first visited in a browser.  Hit OK to force
disclaimer to go away.  There is a userID field, password field and
domain selection field with a dropdown of 10 or so domains.  There is a
single submission button on the page.

 

Script looks like this:

 

go www.blah.com
fv 3 in_tx_username whoamI
fv 3 in_pw_userpass idunno!
fv 3 in_domain DOMAIN
submit

 

 

After
submitting, another showforms shows you the same forms and you have not
been forwarded to the "home page" as you would have been forwarded to
if you'd used a browser.  If you try to go www.blah.com/homepage - it
says that you're there but a showforms reveals the same forms on the
initial www.blah.com page, which are not correct, meaning you haven't
actually authenticated successfully.

 

Example 2:

 

A
synthetic transaction against a Sharepoint page.  Upon trying to visit
the webpage in a browser, you're presented with a Window'd login box. 
Is there any way for twill to actually respond to that?  Trying to
visit the webpage via twill results in a timeout. Perhaps this is where
the authentication realms come into play but I've not been able to
succeed in using them.

 

Thanks.
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how.
_______________________________________________
twill mailing list
twill@...
http://lists.idyll.org/listinfo/twill
Barry Hart | 24 Apr 2010 23:20
Favicon

Re: Twill Scripting Limitations?

Twill does not support JavaScript at all. If you need JavaScript functionality you should be looking at a
tool that scripts an actual browser such as Selenium or Windmill.

Barry

----- Original Message -----
From: "kron filter" <kronfilter@...>
To: twill@...
Sent: Saturday, April 24, 2010 5:11:43 PM
Subject: Re: [twill] Twill Scripting Limitations?

The doLogin() function that the "in_bu_Login" of type button (JavaScript) is trying to execute is as
follows: 

function doLogin()
{
    var persistInfo = true;
    var cb = getRememberCheckbox();
    if (!persistInfo || !cb || !cb.checked)
    {
        deleteLoginInfo();
    }
    else
    {
        var userName = '';
        var usr = getUserTextbox();
        if (usr) { userName = usr.value; }
        var authSource = 0;
        var sel = getAutoSourceSelect();
        if (sel) { authSource = sel.selectedIndex; }
        storeLoginInfo(userName,authSource);
    }
    var loginForm = document.lform;
    var hiddenLogin = loginForm.in_hi_dologin;
    hiddenLogin.value = 'true';
    loginForm.submit();
} 

From the looks of it, this step isn't actually taking place.. nor do I know how I'd replicate this in Python. 

From: kronfilter@... 
To: twill@... 
Date: Sat, 24 Apr 2010 19:37:57 +0000 
Subject: [twill] Twill Scripting Limitations? 

We need to perform a number of synthetic transactions. 

I 
don't know if I just fail at using Twill or what but I'm having a great 
deal of difficulty with the first two pages I'm trying to create 
scripts for. 

Example 1: 

www.blah.com 
pops up a disclaimer when first visited in a browser. Hit OK to force 
disclaimer to go away. There is a userID field, password field and 
domain selection field with a dropdown of 10 or so domains. There is a 
single submission button on the page. 

Script looks like this: 

go www.blah.com 
fv 3 in_tx_username whoamI 
fv 3 in_pw_userpass idunno! 
fv 3 in_domain DOMAIN 
submit 

After 
submitting, another showforms shows you the same forms and you have not 
been forwarded to the "home page" as you would have been forwarded to 
if you'd used a browser. If you try to go www.blah.com/homepage - it 
says that you're there but a showforms reveals the same forms on the 
initial www.blah.com page, which are not correct, meaning you haven't 
actually authenticated successfully. 

Example 2: 

A 
synthetic transaction against a Sharepoint page. Upon trying to visit 
the webpage in a browser, you're presented with a Window'd login box. 
Is there any way for twill to actually respond to that? Trying to 
visit the webpage via twill results in a timeout. Perhaps this is where 
the authentication realms come into play but I've not been able to 
succeed in using them. 

Thanks. 

The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy. 

Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how. 
_______________________________________________
twill mailing list
twill@...
http://lists.idyll.org/listinfo/twill
Chuck Esterbrook | 1 May 2010 06:36
Picon

Unhandled exception with no details

Hi,

I have a small twill script that often outputs this:

twill-sh -u http://localhost:1515/ basics.twill

>> EXECUTING FILE basics.twill
** UNHANDLED EXCEPTION:
--
0 of 1 files SUCCEEDED.
Failed:
        basics.twill

As you can see, there are no line number and no details about the
exception. Rerunning it might give the same output or it might work
even though no changes have been made to the script or site, like so:

twill-sh -u http://localhost:1515/ basics.twill

>> EXECUTING FILE basics.twill
==> at http://localhost:1515/Account/SignIn
AT LINE: basics.twill:0
AT LINE: basics.twill:2
AT LINE: basics.twill:3
title is 'Sign In'.
AT LINE: basics.twill:4
AT LINE: basics.twill:5
AT LINE: basics.twill:6
AT LINE: basics.twill:7
AT LINE: basics.twill:9
==> at http://localhost:1515/Account/Register
AT LINE: basics.twill:10
title is 'Register'.
AT LINE: basics.twill:12

History: (1 pages total)
        1. http://localhost:1515/Account/SignIn

AT LINE: basics.twill:14

There are 0 cookie(s) in the cookiejar.

--
1 of 1 files SUCCEEDED.

The script is:
"""
code 200
title Sign
find Email
find Password
find Register
# find Forgot

go /Account/Register
title Register

showhistory

show_cookies
"""

Note that:

 * When the script fails, it does so immediately without delay.

 * If I put in a bad command name like "foobar", twill prints the line
numbers and exception details.

Any suggestions on what might be wrong? Or how to get the erroneous
case to output line numbers and exception details?

I'm running Python 2.5 with twill 0.9 installed via easy_install. For
this project, I'm on Win XP Pro SP2.

-Chuck

Gmane