Interaction between navigate and delete cookies built-in actions

This topic describes a possible issue that may arise when you use the navigate built-in action in combination with the delete cookies action.

A common test scenario is to navigate to a given URL in either a newly launched instance of Safari, or within an existing Safari window.In both of these cases, if your test calls the delete cookies built-in action right after the navigate action, the deletion may be inadvertently applied to the previous page session (hence that website), instead of the target URL page session.

Note:
Note that, by definition, the readiness of a webpage is established by its Document.readyState property. A value of complete indicates that the page is ready.

To avoid this problem, it is highly recommended that your test procedure wait for the control until it is available before invoking the delete cookies action. In this manner, you are assured that the action, and all subsequent ones, are applied to the target URL page session.

Scenario

You want to navigate to a shopping cart page, for example, www.shoppingcart.com, from the current page www.scrumboard.com. After navigation, your test attempts to delete the cookies of the target page’s website.

The optimum test procedure should look something like the following:

                        location                  window               handle
navigate                www.shoppingcart.com      scrumboard

                        window                    control              timeout(second)
wait for control        home                      buy this item        20

                        
delete cookies          

wait for control is used to ensure that the web page has completely loaded before the delete cookies action is invoked.


Copyright © 2021 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1(800) 322-0333