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 @ sahipro.com 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:
"
ERROR
Step >_sahi._call(window.open("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2";), "gmailWindow");< did not complete in 150 seconds.
"
and
"
_popup("gmailWindow")._setValue(_textbox("Email"), "my_email_address@gmail.com");
Window/Domain not found: popupNameFromStep=gmailWindow; derivedName=; windowName=; windowTitle=; wasOpened=0; domain=
"

here's my code:
var $userMail = "my_email_address@gmail.com";
_call(window.open("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2";), "gmailWindow");
_popup("gmailWindow")._setValue(_textbox("Email"), $userMail);
_popup("gmailWindow")._setValue(_textbox("Passwd"), _prompt("Enter gmail password:"));
_popup("gmailWindow")._click(_submit("signIn"));

i also tried this, but with the same result:
_call(window.open("https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2";));
_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:"));
_click(_submit("signIn"));

and use "https://gmail.com"; 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:
http://sahi.co.in/forums/discussion/3403/crossbrowser-playback-issue/p1

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: http://sahi.example.com/_s_/dyn/Driver_initialized and open the sahi controller
    5. choose my script, e.g. test_gmail_login.sah

    my script code looks like this:
    var $userMail = "my_email_address@gmail.com";
    _setValue(_emailbox("Email"), $userMail);
    _setValue(_password("Passwd"), _prompt("Enter gmail password:"));
    _click(_submit("signIn"));

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

    6. set "https://gmail.com"; as the "start url", click "set"
    7. click "play"

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

Answers

Sign In or Register to comment.