Thursday 27 August 2015

Enabling Coded UI Test playback logs in Visual Studio 2013

Coded UI Tests can fail for a number of reasons, producing detailed logs that can be used to rapidly identify what caused the failure.To enable this level of detail in the test results, open explorer and go to the following folder.
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\
In this location you will find QTAgent32.exe.config. Before opening files in this directory, be sure that you have the permissions to edit and save files.
Locate the following section in the configuration file and set the “EqTraceLevel” to 4.
<system.diagnostics>
  <switches>
    <!-- You must use integral values for "value".
          Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. -->
    <add name="EqtTraceLevel" value="4" />
  </switches>
</system.diagnostics>
Then scroll down to the appSettings section and a key “EnableHttpLogger” with a value of “true”. Then add another key “EnableSnapshotInfo” with a value of “true
  <appSettings>
 
    <add key="EnableSnapshotInfo" value="true"/>
    <add key="EnableHttpLogger" value="true"/>
 
    <add key="StopTestRunCallTimeoutInSeconds" value="5"/>
    <add key="LogSizeLimitInMegs" value="20"/>
    <add key="CreateTraceListener" value="no"/>
    <add key="GetCollectorDataTimeout" value="300"/>
  </appSettings>



Now when you run a codedUI Test you will see there is an output link in the Test Explorer results
Which in turn will take you to the Test output containing the UITestActionLog.html
Which contains the CodeUI Test Log

Monday 24 August 2015

Cross Browser Testing with CodedUI


Content:

1, Instal the CodedUI Test Cross Browser Plugin

2, Coding Change for Cross Browser Testing

3, Hand Coding for Maximize the Browser Window

 

1, Instal the CodedUI Test Cross Browser Plugin:

1,The Plugin will be downloaded as part of the VS update.

Steps : Open VS 2013 -> Tools -> Extensions and Updates -> Click Online

 
2,The Plugin also be downloaded from following link
3,The extension will be installed in the common file directory of your local machineC:\Program Files (x86)\Common Files\Microsoft Shared\VSTT”
 2, Coding Change for Cross Browser Testing
1, Create the Test Initialize method called MyTestInitialize().
2, Change the Current Browser Property of Browser window class.
Eg: BrowserWindow.CurrentBrowser = ”Chrome”
      BrowserWindow.CurrentBrowser = ”Firefox”
 
3, Hand Coding for Maximize the Browser Window
Cross browser does not support the default “Maximize”. So we want to write      the hand coding to Maximize the browser window.
A, Create object for Browser window class
B, Give the URL to launch the website when Browser window open
C, Maximize the Browser Window