Coded UI

Coding for to open the application with Brower while using Coded UI  

Syntax :
 System.Diagnostics.Process.Start("IExplore.exe", "Application Url");

Example : 
 System.Diagnostics.Process.Start("IExplore.exe", "http://premera:8083/Premera.BCP.WebApplication/Login.aspx");

------------------------------------------------------------------------------------------------------------
Selecting the values from multiple Lookup window on the same page

I am facing the problem while "Selecting the values from multiple Lookup window" on the same page  in my application.Finally, we got solution for that issue.This solution may help if anyone facing the problem for your application using Coded UI.


Solution for Selecting the values from multiple Lookup window on the same page Using Coded UI.

Issue :
In our Application, some of the pages have multiple lookup screen. If the page contains one Lookup option, codedUI easily gets the value from the lookup window, whereas if the page contains more than 1 lookup option, CodedUI fails to select the values from 2nd, 3rd  Lookups while playback.

Solution :
Inserting the below code, after execute the first look up.

this.UIMap.UIAssociateWebpageDialWindow.Find();

Example : ( Following the below 4 steps)


1. Code for click and Enter the First Lookup :

  Mouse.Click(this.UIMap.UIPremeraBusinessUnitMWindow.UIPremeraBusinessUnitDocument.UIContactPersonLookupButton1);
  this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UISearchTextBoxEdit.Text = “Reid”;
  Mouse.Click(this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UISearchButton);
  Mouse.DoubleClick(this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UIReidCell);


2. Code for Click the Second look up Icon :

  this.UIMap.UIPremeraBusinessUnitMWindow.UIPremeraBusinessUnitDocument.UIDirectororVPLookupButton.SearchProperties.Add(HtmlButton.PropertyNames.Id, "ctl00_MainEntry_BusinessUnit_BusinessUnitGridView_ctl", PropertyExpressionOperator.Contains);
  Mouse.Click(this.UIMap.UIPremeraBusinessUnitMWindow.UIPremeraBusinessUnitDocument.UIDirectororVPLookupButton);

3. Adding the Solution Code :

                this.UIMap.UIAssociateWebpageDialWindow.Find();

4. Code to select the value for Second Lookup

   this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UISearchTextBoxEdit.Text = “Davis”;
  Mouse.Click(this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UISearchButton);
  Mouse.DoubleClick(this.UIMap.UIAssociateWebpageDialWindow.UIAssociateDocument.UIDavisCell);

No comments:

Post a Comment