Is there any solution for session expiry directly after login?

23 views Asked by At

By using test complete tool, I am trying to record a specific scenario the problem is when I record or playback after login I will find the system asking me for password as the session expired. Is there any solution for this using test Complete tool?

Note: If I am trying manually it's not happening and I login to the system successfully.

1

There are 1 answers

0
primehunter On

This is just a 'raw' idea: You could start by checking in your automation whether the dialog for entering the password is available or not. If the dialog is available, then the automation should enter the password first. Otherwise, the automation should continue as usual. Depending on the technology you are using (a web, mobile or desktop application) and depending on how your automation is structured (Gherkin, keyword test ...) and which language your project uses (JavaScript, C# ...), the specific steps are different. Just as an example: We have a similar case. (We automate a web app, use Gherkin to define the tests and implement the steps in JavaScript). After starting the browser i.e. the app, we first check whether the user needs to log in or not. In our case, it is very easy because we can get a Page object (page = Sys.Browser("chrome").Page(homepage)) and then use guiObj = page.FindChildByXPath(xpath, true) to get an element in the log-in dialog of our app. (Where xpath is an XPATH expression to identify an element from the login dialog.) If the guiObj is defined, then we call the enterPassword(user) function.
Otherwise, automation runs the next steps without it. I hope this idea helps you.