|
Main Idea: The SetUserAgent command lets eValid "pretend" to be any browser you wish it to be, and this feature can be used to validate server behavior that involves alternative responses based on browser type (including, as the example shows, denial of support to specific browsers).
Summary
This page illustrates how to manipulate
the eValid browser's user agent string
to some of the various known "Agents" and pretends to be other browsers.
This can either be done within a playback script, or it
can be done with the -AGENT command line switch.
A key resource on the web for this illustration is the www.useragentstring.com website, which returns detailed information about the user agent string that is reported by your browser [whatever one you're using].
Script Behavior Described
Here is a step by step description of how this script works.
From the starting page we show the script line that sets the UAS as Opera:
eValid Script Used
Here is the script used to produce the eValid playback above:
ProjectID "TestScriptLanguage" GroupID "PlaybackOriented" TestID "2-user-agent" LogID "DEFAULT" ScreenSize 1280 1024 FontSize 2 DeleteCache DeleteCookies # Defaulted IE compatible browser on Startup... InitLink "http://www.e-Valid.com/Products/Documentation.9/UserAgent/agentpage.html" Wait 3223 FollowLink 0 41 "docs.google.com" "http://docs.google.com/" "" SubFrameSet 1 "Welcome to Google Docs" #Wait 17535 SyncOnText 1 "Password" InputValue 1 93 "TEXT" "Email" "Email" "evalid" "" "" Wait 1468 InputValue 1 101 "TEXT" "Passwd" "Passwd" "XXXXXXXXXX" "" "" InputValue 1 107 "CHECKBOX" "PersistentCookie" "PersistentCookie" "yes" "" \ "FALSE" "" Wait 1592 SubmitClick 1 114 "" "signIn" "Sign in" "" Wait 5509 FollowLink 1 66 "Sign out" "http://docs.google.com/logout?hl=en_US" "" Wait 1448 GotoLink 1 "http://www.useragentstring.com/" "" Wait 5227 WindowClose 1 # Change to the OPERA browser for the next navigations, known to be INCOMPATIBLE... Wait 1159 SetUserAgent "Opera/8.51 (Windows NT 5.1; U; en)" Wait 2663 FollowLink 0 41 "docs.google.com" "http://docs.google.com/" "" SubFrameSet 2 "Welcome to Google Docs" SyncOnText 2 "Password" InputValue 2 93 "TEXT" "Email" "Email" "evalid" "" "" Wait 1468 InputValue 2 101 "TEXT" "Passwd" "Passwd" "XXXXXXXXXX" "" "" InputValue 2 107 "CHECKBOX" "PersistentCookie" "PersistentCookie" "yes" "" \ "FALSE" "" Wait 1592 SubmitClick 2 114 "" "signIn" "Sign in" "" Wait 3448 GotoLink 2 "http://www.useragentstring.com/" "" Wait 5227 ValidateSelectedText 2 31 0 "Opera" "" #ValidateSelectedText 2 0 "Opera" "" WindowClose 2 # Change to the FIREFOX browser for further navigations, known to be COMPATIBLE... Wait 1183 SetUserAgent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; " \ "rv:1.8.1.8) Gecko/20201008 Firefox/2.0.0.8" Wait 2663 FollowLink 0 41 "docs.google.com" "http://docs.google.com/" "" SubFrameSet 3 "Google Docs" SyncOnText 3 "evalid@gmail.com" Wait 4509 FollowLink 3 66 "Sign out" "http://docs.google.com/logout?hl=en_US" "" Wait 1448 GotoLink 3 "http://www.useragentstring.com/" "" ValidateSelectedText 3 31 0 "Firefox" "" Wait 5227 WindowClose 3 # End of script. |