cancel
Showing results for 
Search instead for 
Did you mean: 

IRPA - Delete cookies whenever run/debug the script while launching browser

0 Kudos

We are trying to automate S4Cloud web applications (Logon), though manually logged off from the application on the browser before running IRPA script in Debug mode, some times directly takes to Home screen by skipping the Login screen.

Please suggest if can insert delete cookies code before launching the browser or similar solution. As in Selenium

driver.manage().deleteAllCookies() method present, is there similar one in IRPA.

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor

If you want to access the cookie of the webpage that you opened, you can use the below code.

var infos = Activities.ActivitiesPage.getInfos();
		infos.document.cookie

but to clear the cookie from a browser, you have to implement the javascript code like below.

https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript

and Why don't you use wait multiple to switch between logon and lauchpad page?

0 Kudos

Thanks a lot for the guidance, will try the solution.

maheshpalavalli
Active Contributor

lakshmil I would still recommend you to manage this using wait multiple , but if you want to delete cookies, then use that javascript code, but to execute that javascript code inside the browser, you need to user execscript function of the irpa, check the below blog.

https://blogs.sap.com/2020/07/22/injecting-sap-conversational-ai-chatbot-into-a-website-using-sap-in...

Answers (0)