Things to consider while building Login and Logout utility for Web application

In Web automation using Certify, it is important to create a better login and logout utility. Some of the steps are essential while creating these two utilities, and apart from those there are certain additional steps which are implemented in order to get faster and error free executions.

Suggested Steps for building Login utility for web application:

A login process in a web application generally requires loading the browser, entering username and password, and clicking login/sign in button. In addition to these mandatory steps to login to an web application such as CRM , SAP Portal etc. clearing browsing cookies, browsing history and temporary internet files are some of the important steps which otherwise needs to be performed manually. Below are the steps for building a Login utility in Certify:

  1. Execute a DOS command to clear browsing cookies – This is to be done by adding an input DOS command action step by passing DOS command RunDll32.exeInetCpl.cpl,ClearMyTracksByProcess 2
  2. Execute a DOS command to clear browsing history – This is to be done by adding an input DOS command action step by passing DOS command RunDll32.exe
    InetCpl.cpl,ClearMyTracksByProcess 1
  3. Execute DOS command to clear temporary Internet files-This is to be done by adding an input DOS command action step by passing DOS command RunDll32.exe
    InetCpl.cpl,ClearMyTracksByProcess 8
  4. However deleting the browser history is optional and project specific. Also instead of using separate commands to clear the cookies, files etc. as mentioned in point 1, 2, 3 there is another command which can also be used. RunDll32.exe  InetCpl.cpl,ClearMyTracksByProcess 255– This single command can be used to delete all.
  5. Execute DOS command to kill any opened IE browser- This is to be done by adding an input DOS command action step by passing DOS command taskkill /f /im iexplore.exe . This DOS command taskkill /f /im iexplore.exe can be used provided there is no other application running. For example : If the Certify processes are executed from ALM then you should not close the ALM, otherwise you will not be able to execute the processes only. So, it is better to first check if the application to be automated is already opened and accordingly close it.
  6. Load the browser
  7. Add a step to verify loading of the browser is complete. For this you can use “IsVisible” action step for an object (select an object which is always available in the Login page, for example Login button) and provide ‘Timeout’ i.e. the maximum time till which you expect Certify to find the object in the page.
  8. Add step to maximize the application, enter Username, Password.
  9. If the application has ‘Remember Me’ option, then add a step to uncheck it.
  10. Add a step to press Login/SignIn button
  11. If the application has an option or a checkbox which says ‘Cancel all existing logons’ , then add a step to uncheck it and press Continue.
  12. Add an “IsVisible” action step on an object (select an object which is always present after login to the application)
    Steps to create a Logout utility for web application:

    1. Add a step to press the Logout.
    2. Add IsVisible action step on an object in the Login Page. This is an optional step but better to put in order to confirm logout has happened successfully.
    3. Add step to close the browser or add a step to kill the browser.

    Note: The Timeout to be used for the IsVisible steps depend on the performance of the web application. So in web automation it is very important to observe the behavior of the objects involved and accordingly decide the Timeouts. Sometimes the applications are slow and take more time , in that case you can increase the ‘Timeout’.

    Though above steps are necessary for the Login and Logout utilities, the script developers can have some other additional or modified steps and actions which they notice that they consistently work well on multiple executions.

    Contribution by Srabanti Pramanik

Leave a Reply

Your email address will not be published. Required fields are marked *