Troubleshooting and best practices

The following are some industry best practices:

  • An important aspect to consider with the user agent approach is that while switching user agents, a new session of the browser should be started every time in order to ensure that cookies are cleared, and the server is able to send the response as per the new user agent string.
  • Another aspect is to periodically clear all temporary files of the browser and also to clear its cache while running automation scripts. The following is a code snippet for VB Script that can be used with tools such as UFT, which do not have inbuilt constructs for deleting browser cookies or whose inbuilt cookie deletion functions do not work properly:
    Dim objFileSystem, objWshShell, objoFolder, ...

Get Mastering Mobile Test Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.