Your e-Business Quality Partner eValid™ -- Automated Web Quality Solution
Browser-Based, Client-Side, Functional Testing & Validation,
Load & Performance Tuning, Page Timing, Website Analysis,
and Rich Internet Application Monitoring.

eValid -- Testing Microsoft Office 365 -- Example #1
eValid Home

  1. Summary
    Automating a login for the Microsoft Office 365 application presents complications because of the nature of the login process. This example illustrates how eValid structural testing can overcome the problem and successfully log in to the site.

    The eValid recording engine cannot always determine which action to take for an input region, particularly if that region is supported by underlying JavaScript. That's the case in the Office 365 login page (shown below). In such situations the eValid recording will usually be silent -- that is, eValid won't attempt to write an action command that it knows will be inaccurate.

  2. Test Plan
    Below is the testplan for Example #1. (The SalesForce account used is a temporary one; it may not be available in the future.) The idea of the test is to log into the account, create a new unique customer, add some data to that customer's record, confirm that the new customer data is present, and then log off.

    It's up to the user to "sign off" after accomplishing the login process

  3. Developing the Test Script
    The normal recording process does not work correctly because the initial login is not a normal TEXT field entry. Instead, an email address you type in is taken immediately to the Microsoft environment and verified as a valid and known email account. If the email is not recognized the web server directs the user to an alternative page that asks you to set up an account. This extra step requires that you use an existing Microsoft Office 365 setup.

    Here are the steps we used to develop the script shown below.

    1. Here is the starting page, which is asking for login credentials. To make sure you have the fully loaded page we added a sync on teext for the phrase "Keep me signed in".

    2. The actual input area for Element 125 is shown via PageMap analysis.

    3. After manual scripting the addition of the Account Name (the required email address) here is how the page appears. To do this required searching for the specific element id "cred_userid_inputtext", and then setting the value of "value" to the email account name. (The actual email address in the script has been obscured; you must use a live email here.)

    4. Now, we have to locate the correct DOM position for the password, which turns out to be Element 125 as shown via the PageMap display.

    5. Now we need to force the password into this input field. To do this we first sync on the availability of the "cred_password_container" element (to confirm the page has been successfully updated), and then insert the password into the ""cred_password_inputtext" field. (The actual password in the script has been obscured; you must use a live password here.)

    6. Here is the input field after forcing the password data into that page element. What shows on the screen is a sequece of dots.

      Now all that is needed is to click on the "Sign in". We know the element id for "cred_sign_in_button" so it is easy to issue an ElementClick command at that location (which actually is a graphic image).

    7. Note that the signoff is in German (because the email account speified an address in a German speaking country).

  4. Test Script
    Here is the test script that logs in with minimal delay times. Note that some fixed-length Delay commands are included to give the local client time to process all of the JavaScript. With experimentation these could be reduced significantly or eliminated in favor of an active synchronization step.

    # Recording by eValid V9 
    # Copyright (c) 2015 by Software Research, Inc. 
    # Recording made on: Microsoft Windows 7 Service Pack 1 
    ProjectID "Project"
    GroupID "Work"
    TestID "office365"
    LogID "AUTO"
    InitLink ""
    # Wait 9913
    # Manual Insert -- Confirm asynchronous arrival at starting page.
    SyncOnElementProperty 0 "id" "keep_me_signed_in_label_text" ""
    # Manual Insert -- For security reasons the userid is not recorded by eValid recorded out-of-box. 
    IndexSet 0
    IndexFindElement 0 DOWN "id" "cred_userid_inputtext" ""
    ValueSet ""
    ValuePutElement 0 "value" ""
    TabKey 0
    Delay 1000
    # Manual Insert -- Replaced with sync to lessen any unnecessary waits before inserting password.
    SyncOnElementProperty 0 "id" "cred_password_container" ""
    # Manual Insert -- For security reasons the password is inserted directly in the DOM.
    IndexSet 0
    IndexFindElement 0 DOWN "id" "cred_password_inputtext" ""
    ValueSet "XXXXXXXXX"
    ValuePutElement 0 "value" ""
    Delay 100
    TabKey 0
    Delay 2000
    # Go ahead and click on "Sign in"...
    ElementClick 0 157 868 270 "cred_sign_in_button" "Sign in" "" NAV
    Wait 6232
    # Confirm success of login process.
    # End of Script