Hardware & Software Requirements

The test automation environment will require at least one PC. If you wish to run multiple tests simultaneously, you will need additional Virtual Machines (VMs) or servers. Before you can begin writing automated test cases, you will need to get your development system setup with the required software. Selenium works best if all its parts are running in 32-bit or 64-bit. Since we test in multiple browsers on different platforms, it is best to use 32-bit. As you install each program below, please select 32-bit versions. This includes IE9. If IE9 is already installed on your system, verify that you also have the 32-bit version and it is set as your default browser. Otherwise, you will need to download and install 32-bit IE9.
The following is the hardware and software requirements in order to develop and test with Crystal Test and Selenium

Setting Up Your Local Folders

Before breaking out into a full test grid setup, we will first learn to write and execute tests on our local machine. The following sections will walk you through everything you need to do to setup your local machine with Selenium and Crystal Test.

Setting Up Your Development Folder

The Development folder will be the container for most of the files needed for QA Automation as well as documentation, backups, scripts and more. Before we begin, create a folder named Development at the root directory (C:\Development). If you already have a folder called Development, you may use another name but you will need to substitute that name wherever it may apply throughout this handbook.

If you have not received a CD, thumb drive, or zip file with the source code, please read through Downloading Crystal Test with Tortoise. Your Development folder should now have the following folders inside:
  • Database Backups
  • Database Scripts
  • Documentation
  • SeleniumServer
  • Crystal Test

Setting Up Your Local Email Folder

Crystal Test uses email to deliver test results. Since we do not have an email server on our local machine, Crystal Test sends the emails as .eml files to a local folder. Remember to delete these files periodically as they will start to accumulate.

In the root directory, create a folder named CrystalTestEmail (C:\ CrystalTestEmail). If you do not like this folder name, you can follow the instructions below to change it.

Changing the Local Email Folder Name

When changing the local email folder name, change the following 2 files so the code can find your folder:

web.config and AutomationTestEngine\app.config
<mailSettings>
     <smtp deliveryMethod="SpecifiedPickupDirectory">
          <specifiedPickupDirectory pickupDirectoryLocation="C:\CrystalTestEmail" />
     </smtp>
</mailSettings>

The Stage & Production version of Crystal Test will actually deliver emails to you, so you may want to create a rule in your email program to automatically put these emails in a specific folder. Refer to the help files of your email program to learn how to create an email rule.

Registry Settings

Warning: Editing a registry can be harmful to your computer. If you are not familiar with editing your registry, you should have a professional configure these settings for you.

Set TypeGuessRows to Zero

This configuration needs to be set on your local machine and the VM that contains the webserver hosting Crystal Test.
When importing data from an Excel spreadsheet, the ISAM driver, by default, looks at the first eight rows and determines the data-type. Also, it looks at these 8 rows and determines whether to allow more than 256 characters in a text string. If there is no data in the first 8 rows that defines the exact nature of your data, chances are Excel will truncate your data and/or determine it a data type other than what you intended. In order to fix this, when writing your connection string, use the setting IMEX=1 which tells the driver to use Import mode. In this state, the registry setting ImportMixedTypes=Text will be noticed. This forces mixed data to be converted to text. For this to work reliably, you may also have to modify the registry setting, TypeGuessRows=8. If this eight row sampling is all numeric, then setting IMEX=1 will not convert the default data-type to Text; it will remain numeric.
You must be careful that IMEX=1 not be used indiscriminately. This is IMPORT mode, so the results may be unpredictable if you try to append or update data in this mode.
The possible settings of IMEX are: 0 is Export mode - 1 is Import mode - 2 is Linked mode (full update capabilities)
This configuration is imperative for using the Excel Import/Export feature of Crystal Test. To make this configuration, follow these steps:
  1. In your Start menu, click Run
  2. Enter Regedit and hit enter.
  3. From the menu, Edit  Find
  4. In the Find What box, enter TypeGuessRows and click the Find Next button
  5. Right click on the entry and select Modify…
  6. Change the value data to 0 (zero).
  7. Press F3 to continue searching for the next entry
  8. Repeat steps 5-7 to search the registry for all instances of TypeGuessRows and set to 0 (Default is 8). Depending on your installations you may have all, some, more, or none of the keys below.
    1. HKEYLOCALMACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel
    2. HKEYLOCALMACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Lotus
    3. HKEYLOCALMACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Excel

Turn off Autocomplete

The first time a user enters a value in a field on a web form, Internet Explorer prompts the user with whether they want to turn on auto-complete. This feature will automatically fill in fields based on the users past entries.
Since we start most automated tests without cookies and cache, this prompt often pops up during an automated test interrupting the test. For this reason, we want to turn this setting off at the registry level, so it never prompts us. Follow these steps to turn off auto complete in the registry.
  1. In your Start menu, click Run
  2. Enter Regedit and hit enter.
  3. Navigate to HKEYCURRENTUSER\Software\Microsoft\Internet Explorer\IntelliForms
  4. Right-click on the AskUser key and select Modify…
  5. Set the value data to 0 (zero).
  6. Navigate to HKEY_USERS\.DEFAULT\ Software\Microsoft\Internet Explorer\IntelliForms
  7. Right-click on the AskUser key and select Modify…
  8. Set the value data to 0 (zero).

Visual Studio

Crystal Test was developed in C# using Visual Studio 2010/2012 (.NET 4.0). In order to extend Crystal Test or write data-driven test cases to be used by Crystal Test, you will need to install Visual Studio 2010 or later.

Installing Visual Studio

If you do not have an MSDN license, you can download Visual Studio Express at http://www.visualstudio.com/en-US/products/visual-studio-express-vs for free. Installation instructions for setting up Visual Studio are beyond the scope of this document, but you may refer to http://msdn.microsoft.com/en-us/library/e2h7fzkw.aspx for instructions on how to download and install Visual Studio.

When you start Visual Studio for the first time, you will be asked to select a default environment. You will want to select C#.

Installing .NET 4.0

After installation, verify that .NET 4.0 has been installed on your local machine. Follow the instructions at http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx to verify which .NET versions are installed. If .NET 4.0 is not installed, you can download it at http://www.microsoft.com/en-us/download/details.aspx?id=17851
The Windows Imaging Component is a prerequisite for installing .NET framework 4 on Windows Server 2003/Windows XP) as well as other versions prior to Vista. You can download this file at http://www.microsoft.com/en-us/download/details.aspx?id=32

Java

Selenium requires the installation of Java. Java comes in 32-bit and 64-bit versions. As I mentioned previously, since we will be testing on various systems with varied setups, it is best we install 32-bit versions.

Installing Java

Install the 32-bit JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html
  1. Download the file to your system.
  2. Run the Java installation file choosing all default installation options.
  3. Verify you have a file called tools.jar at a path like C:\Program Files\Java\jdk1.7.0\lib\tools.jar, if you don't have a file with a similar path, you have done something wrong.

Configuring Java Environment Variables

  • Open the Control Panel -> System or Security –> System or Click Start and then right-click on Computer and select Properties
  • Select Advanced System Settings option
ComputerProperties.png
  • Select the Environment Variables option
SystemProperties.png
  • In the System variables section, click the New button
EnvironmentVariables.png
  • Define the variable name, JAVAHOME and its value C:\Program Files (x86)\Java\jdk1.7.045 (If needed, modify this value to reflect the current version folder name)
EnvironmentVariables-JavaHome.png
  • For PATH, if it already exists, select it and choose the Edit option; in the editor add the value; %JAVA_HOME%\bin (the new values are separated by a semicolon from the existing ones)
EnvironmentVariables-JavaHome.png
  • Insert a new system variable named, CLASSPATH and its value C:\Program Files (x86)\Java\jre7\lib\ (update to match the path to your lib folder of your Java JRE installation.)
  • Restart the computer in order to make your system aware of these changes

Testing the system variables is done by opening a new command prompt window (Start -> cmd) and typing each of the following to echo the respective paths:
echo %CLASSPATH%
C:\Program Files\Java\jdk1.7.0_16\jre\lib
 
echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_16
 
echo %PATH%
SQL
Crystal Test requires the installation of SQL Server 2008 R2 or later. The database backup that came with Crystal Test was created in SQL Server 2012.

Installing SQL

If you do not have an MSDN license, you can download Microsoft SQL Express at http://www.microsoft.com/en-us/sqlserver/editions/2012-editions/express.aspx for free. Installation instructions for setting up Microsoft SQL are beyond the scope of this document, but you may refer http://msdn.microsoft.com/en-us/library/ms143219.aspx for instructions on how to download and install Microsoft SQL.

When installing SQL, be sure to assign yourself permissions for all SQL functions. Also, if you implemented a named instance rather than the use of localhost, you will need to implement that where localhost is referred to in this handbook.

This system assumes 3 different Crystal Test environments;
  • Local (Development)
  • Stage (Testing)
  • Production (Live Test Data and Results).

The connection strings are already configured for these environments and assumes the database names to be CTLocalDB, CTStageDB, and CTProductionDB. You can change these names as desired but you will need to update any references to them in the config files. (See Changing the Database Name)

Restoring an SQL Database

These instructions are for SQL Server 2012. If you are using a different version, you can view instructions for restoring a database at http://msdn.microsoft.com/en-us/library/hh529829.aspx.

Until an installation application is created for Crystal Test, the initial database comes in the form of a database backup. The backup files are stored in a datestamped format to ensure you get the latest version.

Example: CTLocalDB 2014-01-12 1413.bak

Once you have SQL installed, you will need to restore the CTLocalDB database (C:\Development\Database Backups). If your company is already using Crystal Test and has a production environment already setup, you will want to back up your company’s current production version and restore it to your local machine (See Backing up an SQL Database).
  • Before restoring the initial database, always make sure you have the latest copy from http://crystaltest.codeplex.com
  • Open your local SQL Server Management Studio
  • Log into localhost using Windows Authentication (you should see your own credentials in the Username box greyed out. You do not need to enter a password as this information will come from your Windows login credentials)
  • Click Connect.
SQLLogin.png
  • If you do not see the Object Explorer on the left side of the screen, press F8.
  • Expand localhost and Databases
  • If there is already a CTLocalDB database present, right-click it and delete it.
  • Right-click on Databases and select Restore Database…
SQL-RestoreDatabase.png
  • In the Source section, select the Device radio button.
  • Click the Elipse button to browse for the CTLocalDB YYYY-MM-DD HHMM.bak file
  • Verify that File is selected in the Backup Media box and click the Add button.
  • Navigate to the C:\Development\Database Backups folder and select the CTLocalDB.bak (or other desired file) file or the production backup file you created and committed to Subversion. You should then see it listed in the Specify Backup screen as shown below.
  • Click OK.
SQL-RestoreDatabase3.png
  • You should now see the path to your file in the From Device box on the Restore Database window. Verify that ‘CTLocalDB’ is still in the To Database box. Check the Restore checkbox and click OK.
SQL-RestoreDatabase2.png
  • You should then get a message that the database has been restored successfully.
  • Click OK.
SQL-RestoreSuccessfully.png

Backing up an SQL Database

It is often useful to backup a database for security or mobility purposes. You may need to copy a database from production to a local environment, or secure it before making major changes. The following instructions will show you how to backup an SQL database.

These instructions are for SQL Server 2012. If you are using a different version, you can view instructions for restoring a database at http://msdn.microsoft.com/en-us/library/ms187510%28v=sql.120%29.aspx
  • Open your local SQL Server Management Studio
  • Log into localhost using Windows Authentication (you should see your own credentials in the Username box greyed out. You do not need to enter a password as this information will come from your Windows login credentials) Click Connect.
  • Expand the Databases folder and right-click on the database you wish to backup, select Tasks --> Backup…
SQL-BackupDatabase.png
  • If anything is listed in the Destination section, selected it and remove it.
SQL-BackupDatabase2.png
  • Click the Add button to create a new backup file
  • In the File Name box, scroll all the way to the right and add CTLocalDB YYYY-MM-DD HHMM.bak (military time), after Backup\ then click OK. Then click OK again.
SQL-BackupDatabase-.SelectDestination.png
  • (Optional) You can now copy the file you just created from the SQL’s backup folder (C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup) to the Database Backup folder at C:\Development\Database Backups

Changing the Database Names

You may decide to use different database names in your project. If so, follow the instructions below to change the database name.
  • Make sure to close SQL, Visual Studio, and any other program referencing your database.
  • Navigate to your SQL DATA folder. (C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA)
  • Right-click the database and rename it.
  • Rename the corresponding log file as well.
Note: In the Database Scripts folder (C:\Development\Database Scripts), you can use the Modify Logical Database and Log Names.sql file to rename the logical database and log names.
  • When changing the database name, there are a few places that will need to be updated in code. Change the following files to update Crystal Test with the new database name.
    • C:\Development\Crystal Test\Projects\CTWebsite\TestCaseWithStatus.xsd
    • C:\Development\Crystal Test\Projects\CTWebsite\web.config
    • C:\Development\Crystal Test\Projects\AutomationTestEngine\app.config
TestCaseWithStatus.xsd
<DbSource ConnectionRef="QAAConnectionString (Web.config)" DbObjectName="*CTLocalDB*.dbo.TestCaseWithStatus" DbObjectType="View" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">

web.config and AutomationTestEngine/app.config
<connectionStrings>
    <!-- PRODUCTION -->
    <!--<add name="QAAConnectionString" connectionString="Data Source=mdev-wn8147;Initial Catalog=CTProductionDB;user id=PutYourIdHere; password=PutYourPasswordHere" providerName="System.Data.SqlClient" />-->
    <!-- STAGE -->
    <!--<add name="QAAConnectionString" connectionString="Data Source=mdev-wn8147;Initial Catalog=CTStageDB;user id=PutYourIdHere; password=PutYourPasswordHere" providerName="System.Data.SqlClient" />-->
    <!-- LOCAL -->
    <add name="QAAConnectionString" connectionString="Data Source=localhost;Initial Catalog=CTLocalDB;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>

Update the Web.config providers. (See the next section)
!!Updating the Web.config Providers
  • Run aspnetregsql.exe (C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnetregsql.exe)
  • Open the Crystal Test solution in Visual Studio
  • Press F5 to run the application
  • Open the ASP.NET Configuration (Visual Studio menu: Project --> ASP.NET Configuration)
ASPNET COnfiguration.png
  • Click the Application Configuration link.
ASPNET COnfiguration2.png
  • Click the Take application offline link
ASPNET COnfiguration3.png
  • Click the Take application online link
  • To verify the providers are updated, click the Security tab. If you are able to see the sections displayed in the image below, all is good, otherwise you will see an error.
ASPNET Configuration4.png

Browsers

Automating web-based tests require certain settings to be in place to avoid interuptions during test execution. The following sections instruct how to install and configure your browsers for automating testing.
Note: The browsers in which you will need to configure will be solely based on the browsers the application under test (AUT) is intended to support. Each AUT may require tweaking of these settings depending on the expected behavior of the test and the UAT.

Internet Explorer

You will need to decide which version of Internet Explorer you will use on your local machine. To maintain that version, be sure to turn auto-updating for Internet Explorer off. I have found it is easiest to set most of Internet Explorer settings in group policy. You can either send the list below to your team in charge of maintaining active directory or use your local group policy settings on your computer.

To open your local group policy:
  1. Click Start
  2. Click Run…
  3. Type gpedit.msc and press enter.

Internet Explorer 9 Settings

  • Computer Configuration > Administrative Templates > Windows Components > Internet Explorer
    • Turn on menu bar by default = enabled
    • Turn off Managing Phishing filter = Enabled (Dropdown = Off)
    • Prevents performance of the First Run Customize settings = Enabled (Dropdown = Go directly to homepage)
    • Configure new tab page default behavior = Enabled (Dropdown = Homepage)
  • Internet Explorer > Accelerators
    • Turn Off Accelerators = Enabled
  • Internet Explorer > Delete Browsing History
    • Configure Delete Browsing History = Enabled
  • Internet Explorer > Internet Control Panel > Advanced Page
    • Automatically Check for Internet Explorer Updates = Disabled
    • Empty Temporary Internet Files folder when browser is closed = Enabled
  • Internet Explorer > Internet Control Panel > Security Page (Set the following settings in all 10 Zones)
    • Use Pop-up Blocker = Disabled
    • Display Mixed Content = Enabled (Dropdown = Enabled)
    • Turn off first-run opt-in = Enabled (Dropdown = Enabled)
    • Use SmartScreen Filter = Disabled
    • Turn on Protected Mode = Enabled (Dropdown = Enabled)
  • Internet Explorer > Internet Settings > AutoComplete
    • Turn Off Windows Search AutoComplete = Enabled

Internet Explorer 10 Settings

  • Computer Configuration > Administrative Templates > Windows Components > Internet Explorer >
    • Turn on menu bar by default = enabled
    • Prevent managing the smart screen filter = Enabled (Dropdown = Off)
    • Turn off Reopen Last Browsing Session = Enabled
    • Prevent Managing the Phishing filter = Enabled (Dropdown = Off)
    • Install new versions of Internet Explorer automatically = Disabled
    • Specify default behavior for a new tab = Enabled (Dropdown = Homepage)
    • Prevent running First Run Wizard = Enabled (Dropdown = Go directly to users homepage)
    • Disable showing the splash screen = Enabled
    • Prevent periodic checks for Internet Explorer software updates = Enabled
    • Turn off the AutoComplete feature for web addresses = Enabled
    • Prevent participation in the Customer Experience Improvement Program = Enabled
    • Security Zones: Use only machine Settings = Enabled
  • Internet Explorer > Accelerators
    • Turn Off Accelerators = Enabled
  • Internet Explorer > Delete Browsing History
    • Allow deleting browsing history on exit = Enabled
  • Internet Explorer > Internet Control Panel > Advanced Page
    • Turn on Enhanced Protected Mode = Enabled
    • Automatically check for Internet Explorer Updates = Disabled
    • Empty Temporary Internet Files folder when browser is closed = Enabled
  • Internet Explorer > Internet Control Panel > General Page
    • Start Internet Explorer with tabs from last browsing session = Disabled
  • Internet Explorer > Internet Control Panel > Security Page (Set the following settings in all 10 Zones)
    • Use Pop-up Blocker = Disabled
    • Display Mixed Content = Enabled (Dropdown = Enabled)
    • Turn off first-run prompt = Enabled (Dropdown = Enabled)
    • Turn on SmartScreen Filter scan = Disabled
    • Turn on Protected Mode = Enabled (Dropdown = Enabled)
  • Internet Explorer > Internet Settings > AutoComplete
    • Turn Off Windows Search AutoComplete = Enabled

Firefox

Download and install the latest Firefox from https://www.mozilla.org/en-US/firefox/all/

Set the following configurations in the Firefox options
  • Options --> Security Tab
    • Uncheck the box next to Remember passwords for sites
  • Options --> Advanced tab
    • On the General subtab, Uncheck the box next to Always check to see if Firefox is the default browser on startup
    • On the General subtab, Uncheck the box next to Check my spelling when I type
    • On the Data Choices subtab, Uncheck the box next to Enable Crash Reporter
    • On the Data Choices subtab, Uncheck the box next to Enable Firefox Health Reporter
    • On the Update subtab, select the radio button next to Automatically Install Updates
    • On the Update subtab, Uncheck the box next to Warn Me if this will disable any of my addons

Chrome

Download and install the latest Chrome from https://www.google.com/intl/en/chrome/browser/

Follow the instructions below to configure your Chrome browser.
  1. Click the icon to open google chrome menu
  2. Click Settings
  3. Click the Show Advanced Settings link at bottom of page
  4. Uncheck the box next to Offer to save passwords I enter on the web
  5. Uncheck the box next to Enable Autofill to fill out web forms in a single click
!!Other Browsers
For instructions on how to configure other browsers, please refer to their respective website.


















Last edited Aug 5, 2014 at 6:59 PM by jacquelinewalton, version 15