Pages

Tuesday, December 30, 2014

CodedUI Test manually add assertion method, log messages using TestContext.WriteLine, and using UIMap named UIMap1.uptest instead of UIMap.uitest

I am creating this post about manually updating CodedUI Tests as part of a training exercise for another QA Engineer.

I used Amazon.com as an example, but it 's the same idea with any web application.

Here are the requirements of the CodedUI Test Project:

  1. We don't want to use the CodedUI Test Builder to generate the methods and assertions - we will use the builder to update the UIMap and then hand code the methods and assertions; hand coding of assertions and methods is a good idea because we can avoid extra code that gets generated like hover, mouse over, ect.
  2. Create a UIMap named UIMap1.uitest instead of UIMap.uitest - this is because we are going to hand code the assertions and methods; potentially we could make a separate UIMap for each section of the web application
  3. Generate logging messages using TestContext.WriteLine("message"); -- we could also use Console.WriteLine("message);
  4. Browse and load site using TestInitialize section of the CodedUITest.cs file
  5. Add multiple [Test Method] statements to one CodedUITest.cs file instead of one [TestMethod] for each CodedUITest.cs file
  6. When the test is run the test method is selected from the Test Explorer - this is a good idea because we have a better idea where the failure occurs if we name our Test Methods with meaningful names


STEP #1: Create New CodedUITest Project and manually add UIMap named UIMap1.uitest instead of UIMap.uitest

STEP #2: Rename the default CodedUITest1.cs file and dependencies

STEP #3: Add Controls to UIMap1.uitest - this is a partial class so the generated code will be added to UIMap1.Designer.cs and we'll add custom code to UIMap1.cs

STEP #4: Add the Using directive and Constructor to the CodedUITestAmazon.cs file

STEP #5; Add code to TestInitialize section of the CodedUITest.cs file that loads IE, browse to URL, and log message

STEP #6: Add Custom Assertion to CodedUITest.cs file that verifies properties of an HtmlHyperlink and logs messages using TestContext.WriteLine

Tuesday, July 29, 2014

Configuration Manager 2012 Client Actions

Configuration Manager 2012 Client Actions can be run independently from schedules that are configured in Configuration Manager Console through Control Panel>Configuration Manager on the client machine.

1) Application Deployment Evaluation Cycle: This evaluation Cycle is applicable to software deployments (applications) .This action will re-evaluates the requirement rules for all deployments and make sure the application is installed on the computer. The default value is set to run every 7 days.

2) Discovery Data Collection Cycle:  This action can be considered as Heartbeat Discovery cycle and will resend the client information to site and keeping the client record Active. This is also responsible to submits a client's installation status to its assigned site(Status:Yes).If you are migrating the client from SP1 to R2 or R2 to CU1 ,it takes time to get the client version update in Console and update action is carried out by this Cycle. Heartbeat Discovery actions are recorded on the client in the  InventoryAgent.log.  Computers accidentally deleted from the configmgr console  will automatically "come back" if it is still active on the network. Wait for the next heartbeat inventory cycle, try running Discovery Data Collection Cycle manually, or use custom script. Refer to this link for more information about what is sent back

3) File Collection Cycle: This action is to search for a specific file that you have defined in the Client Agent settings (Software inventory > collect files).  If the software inventory client agent finds a file that should be collected, the file is attached to the inventory file and sent to the site. This action differs from software inventory in that it actually sends the file to the site, so that it can be later viewed using Resource Explorer. The site server collects the five most recently changed versions of collected files and stores them in the \Inboxes\Sinv.box\Filecol directory. The file will not be collected again if it has not changed since the last software inventory was collected.  Files larger than 20 MB are not collected by software inventory. Maximum size for all collected files (KB) in the Configure Client Setting dialog box displays the maximum size for all collected files.  When this size is reached, file collection will stop. Any files already collected are retained and sent to the site.

4) Hardware Inventory Cycle: The first and very important action to send client inventory information. This is where most time is spent troubleshooting  about why the client is not reporting inventory from X days .Many folks think that, hardware inventory is actually getting information about hardware but it is more than that. It inventory information about add and remove programs, OS info, RAM, disk and many things. Hardware inventory is WMI inventory that collects the information from WMI , based on the settings you defined in Client agent settings—>Hardware inventory .Configmgr client will collect only the information that you have selected/customized in client agent settings  and send it to server. Hardware inventory information will be logged into inventoryagent.log

5) ID MIF Collection Cycle Management Information Format (MIF) files can be used to extend hardware inventory information collected from clients by the Configuration Manager 2007 hardware inventory client agent. During hardware inventory, the information stored in MIF files is added to the client inventory report and stored in the site database, where you can use the data in the same ways that you use default client inventory data. Two MIF files can be used when performing client hardware inventories: NOIDMIF and IDMIF. By default, NOIDMIF and IDMIF file information is not inventoried by Configuration Manager 2007 sites. To enable NOIDMIF and IDMIF file information to be inventoried, NOIDMIF and IDMIF collection must be enabled. You can choose to enable one or both types of MIF file collection for Configuration Manager 2007 sites on the MIF Collection tab of the hardware inventory client agent properties. For more information about enabling MIF collection for Configuration Manager 2007 sites during hardware inventory, see Hardware Inventory Client Agent Properties: MIF Collection Tab.

6) Machine Policy retrieval and Evaluation Cycle: This action is to download policies assigned to the client computer. Anything that you assign to a collection (group of computers) like client agent settings or applications related to deployment. This action will be triggered based on a schedule defined in Client agent settings (Policy polling interval (minutes). This action results will be logged into policyagent.log, Policyevalutor.log, and policyagentprovider.log

7) Software Inventory Cycle: Unlike hardware inventory, software inventory, inventory information about file system data and file properties such as .EXE. You can customize what executable files to be inventoried which allows admins to report on software inventory. When this action runs, it inventories the information in the file header of the inventoried files and sends to the  site. This information will be logged into inventoryagent.log on the client. If you are experiencing slow software inventory issues, refer to this link
What is the difference between Hardware and Software Inventory? 
* Hardware Inventory uses WMI to get the information about computer  
* Software Inventory works on files to get information in the file header

8) Software Metering Usage Report Cycle: The name itself says, metering which means, configmgr client monitor and collect software usage data for the software metering rules that are enabled on the Site .Client computers evaluate these rules during the machine policy interval and collect metering data and send it to site.

9) Software updates deployment evaluation Cycle: This action will initiate a scan for software update compliance. This action evaluates the state of new and existing deployments and their associated software updates. This includes scanning for software updates compliance, but may not always catch scan results for the latest updates. This is a forced online scan and requires that the WSUS server is available for this action to succeed.  This action results will be logged into couple of log files on the client: scanagent.log (scan requests for software updates), UpdatesStore.log(Status of patches like missing, Installed),UpdatesDeployment.log(update activation, evaluation, and enforcement, notify about reboot) etc. More info about software update compliance

10) Software Update Scan Cycle: This action scans for software updates compliance for updates that are new since the last scan. This action does not evaluate deployment policies as the Software Updates Deployment Evaluation Cycle does. This is a forced online scan and requires that the WSUS server is available for this action to succeed. This action results will be logged into WUAHandler.log (if Scan is succeeded or not), UpdatesStore.log(Status of patches like missing, Installed),and  scanagent.log (scan requests for software updates) etc

11) User Policy retrieval and Evaluation Cycle: This action is similar to Machine Policy Retrieval & Evaluation Cycle, but this will initiate an ad-hoc user policy retrieval from the client outside of its scheduled polling interval. This action results will be logged to policyagent.log, Policyevalutor.log, and policyagentprovider.log

12) Windows Installer Source list update cycle: This action also very important while installing MSI applications. This action causes the Product Source Update Manager to complete a full update cycle. When you install an application using Windows Installer, those Windows Installer applications try to return to the path they were installed from when they need to install new components, repair the application, or update the application. This location is called the Windows Installer source location. Windows Installer Source Location Manager can automatically search Configmgr 2012 distribution points for the source files, even if the application was not originally installed from a distribution point.

Wednesday, May 7, 2014

IE11/IE10 Blank Page

I was seeing a blank screen in IE11 every time I opened it after installing on a new laptop. This started happening after hitting and exiting IE before closing out of the Developer Toolbar. Tried rebooting, but couldn't get IE to work correctly. 

Found these steps to correct the issue:

1) Start IE11 (or IE10) via the Start->type "Internet"->Select the Internet Explorer (without addons)
2) Once it is up, press F12 to bring up the developer window on the bottom.
3) Once it is up and stable, close it via the X in it's upper corner (the developer window, not the IE11).
4) When the developer window is fully closed, close the IE11 (or IE10).
5) Now try to open IE11 (or IE10) normally to see if it is working.

Monday, January 20, 2014

The old True, False, NULL problem

Say you've got an application where a new check box was added to the screen and a new column was added to the table. The possible values of the check box are are True and False. Maybe the existing rows in the table are set to NULL when the new column is added.

Are existing rows updated?

Does the column have a default value?

Does the application break on rows where the column is set to NULL?

I think existing rows should be set to True or False, but sometimes they're not.

It seems confusing if NULL is being interpreted as True or False.

Just something to check for.

Thursday, January 2, 2014

CodedUI test - check for existence of dialog


If the application has a dialog that is only displayed in certain cases you can write a custom method to execute commands when the dialog exists. This application has a dialog that is only displayed if an add-in could not be loaded.

Execute certain commands when dialog exists:

1. Record the assertion and action on the dialog.

2. Write a new method in UIMap.cs to check for existence of the dialog and execute the recorded assertion and the recorded action.

3. Move calls to the recorded assertion and recorded action from CodedUITest.cs to new method in UIMap.cs.

if (dialog.Exists)
{
    AssertDialogRecorded();
    DialogActionRecorded();
}


4. Add a using statement to UIMap.cs for Microsoft.VisualStudio.TestTools.UITesting.WinControls:


5. Call the custom method from CodedUITest.cs in place of the recorded assertion and the recorded method.
this.UIMap.ClickOKIfDialogExists();