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, oFile 'Deleting temporary folders: Set objFileSystem = CreateObject("Scripting.FileSystemObject") 'Create Window Shell object Set objWshShell = CreateObject("WScript.Shell") 'get Folderpath under which file present...