Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

how to use sahi with gmail?

nickleusnickleus Members
edited March 2013 in Sahi - Open Source
hi, i'm trying to use sahi to login to my gmail (using firefox) and click on a registration link in an email as a party of my company's sahi test case, but i'm getting the following errors:
Step >_sahi._call("<mpl=default<mplcache=2";), "gmailWindow");< did not complete in 150 seconds.
_popup("gmailWindow")._setValue(_textbox("Email"), "");
Window/Domain not found: popupNameFromStep=gmailWindow; derivedName=; windowName=; windowTitle=; wasOpened=0; domain=

here's my code:
var $userMail = "";
_call("<mpl=default<mplcache=2";), "gmailWindow");
_popup("gmailWindow")._setValue(_textbox("Email"), $userMail);
_popup("gmailWindow")._setValue(_textbox("Passwd"), _prompt("Enter gmail password:"));

i also tried this, but with the same result:
_popup("Gmail: Email from Google - Mozilla Firefox")._setValue(_textbox("Email"), $userMail);
_popup("Gmail: Email from Google - Mozilla Firefox")._setValue(_textbox("Passwd"), _prompt("Enter gmail password:"));
_popup("Gmail: Email from Google - Mozilla Firefox")._click(_submit("signIn"));

if i change the script to this:
_setValue(_textbox("Email"), $userMail);
_setValue(_textbox("Passwd"), _prompt("Enter gmail password:"));

and use ""; as the "start url" in the sahi controller, click "set", the gmail login page comes up as usual, but when i click "Play" in the sahi controller, all i get is this, no matter how many times i close the controller and start again:
Please open the Controller again.
(Press CTRL ALT-DblClick on the main window.)

after clicking "set" in the controller, then switching to the "record" tab, i don't get any "alternatives" when i hold control and mouseover elements either.

i don't think it has anything to do with accepting an ssl cert, because the gmail window opens, but then nothing happens--the username and password fields don't get filled out. ideas?

it seems similar to this issue:

Best Answer

  • edited March 2013 Answer ✓
    UPDATE: i just solved this issue.

    1. click "firefox" in the sahi dashboard
    2. click the link "SSL Manager"
    3. copy each domain marked with a red dot, into a tab, prefixed by "https://", hit enter, accept security risk mumbo jumbo
    4. go back to the default page: and open the sahi controller
    5. choose my script, e.g. test_gmail_login.sah

    my script code looks like this:
    var $userMail = "";
    _setValue(_emailbox("Email"), $userMail);
    _setValue(_password("Passwd"), _prompt("Enter gmail password:"));

    NOTE: the username field in gmail uses: _emailbox
    NOT _textbox

    6. set ""; as the "start url", click "set"
    7. click "play"

    so it DID seem to be something with the SSL :)


Sign In or Register to comment.