Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What Are The 4 Major Steps In Ddt?

Answer»

Below are the 4 major steps for DDT in CODED UI:

1.Prepare the test DATA.

  • If working on CSV/XML/EXCEL, create RESPECTIVE file and add the test data.
  • If working on SQL/TFS directly add the test data to respective table/test case.

2.Add the Data Source Attribute.
3.Get the test data from file and map to respective control.
4. Right CLICK on file, go to properties and change the Copy to Output Directory VALUE to ‘Copy always’.

Below are the 4 major steps for DDT in Coded UI:

1.Prepare the test data.

2.Add the Data Source Attribute.
3.Get the test data from file and map to respective control.
4. Right click on file, go to properties and change the Copy to Output Directory value to ‘Copy always’.

2.

How Many Types Of Ddt Available On Coded Ui?

Answer»

Data Driven Testing can be DONE in Coded UI using 5 Data SOURCE TYPES:

  • Using CSV 
  • using XML
  • using EXCEL
  • using SQL 
  • using Test case in TFS

Data Driven Testing can be done in Coded UI using 5 Data Source types:

3.

Explain Playback.playbacksettings.continueonerror?

Answer»

GENERALLY in CODED UI at the time of script execution if any error occurs the execution will stop and TEST method fails.

If the execution wants STILL to continue if any error occurs then the below statement is helpful

Playback.PlaybackSettings.ContinueOnError = true;

Generally in Coded UI at the time of script execution if any error occurs the execution will stop and test method fails.

If the execution wants still to continue if any error occurs then the below statement is helpful

Playback.PlaybackSettings.ContinueOnError = true;

4.

Explain About Data Directory?

Answer»

DATA DIRECTORY MEANS PROJECT Directory/Project FOLDER.

Data Directory means Project Directory/Project folder.

5.

What Is Mouse Click Using Coordinates?

Answer»

Mouse.CLICK(CONTROL, new Point(49, 3));

Coded UI will perform click operation EXACTLY on 49,3 point of the control.

Mouse.Click(control, new Point(49, 3));

Coded UI will perform click operation exactly on 49,3 point of the control.

6.

Explain Waitforcontrolenabled, Waitforcontrolexist And Waitforcontrolready?

Answer»

WaitForControlEnabled(): WAITS for control to be enabled.

WAITFORCONTROLEXIST(): Waits for control to exist on UI.

WaitForControlReady():Waits for the control to be ready to accept keyboard or mouse input.

WaitForControlEnabled(): Waits for control to be enabled.

WaitForControlExist(): Waits for control to exist on UI.

WaitForControlReady():Waits for the control to be ready to accept keyboard or mouse input.

7.

What Are Unconditional Statements In Synchronization?

Answer»

STATEMENTS executed without any CONDITION. In CODED UI there is 1 Unconditional Statement Playback.wait().

Statements executed without any condition. In coded UI there is 1 Unconditional Statement Playback.wait().

8.

What Are Conditional Statements In Synchronization?

Answer»

Statements executes depending on some condition. In CODED UI there are 8 CONDITIONAL Statements:

  • WaitForControlReady()
  • WaitForControlEnabled()
  • WAITFORCONTROLEXIST()
  • WaitForControlNotExist()
  • WaitForControlPropertyEqual()
  • WaitForControlPropertyNotEqual()
  • WaitForControlCondition()
  • WaitForCondition()

Statements executes depending on some condition. In coded UI there are 8 Conditional Statements:

9.

Levels Of Synchronization?

Answer»

TWO levels of SYNCHRONIZATION:

  1. TEST LEVEL Synchronization.
  2. Statement level Synchronization

Two levels of Synchronization:

10.

Difference Between Assert.isequal() And Assert.aresame()?

Answer»

Assert.IsEqual() REFERS to CONTROL VALUE.

Assert.AreSame() refers to REFERENCE of the control.

Assert.IsEqual() refers to control value.

Assert.AreSame() refers to reference of the control.

11.

How Many Assertions Can Be There In A Test Method?

Answer»

There can be any NUMBER on ASSERTIONS.

There can be any number on Assertions.

12.

Why We Are Going Assertions Instead Of If-else?

Answer»

When IF-Else is used and if test case FAILS still Coded UI passes the TestMethod, to overcome this issue Coded UI INTRODUCED ASSERTIONS.

When IF-Else is used and if test case fails still Coded UI passes the TestMethod, to overcome this issue Coded UI introduced Assertions.

13.

Assertion And Uses?

Answer»

Assertions is same as validations which helps to verify if the actual output is same as EXPECTED output.

Below are some IMPORTANT classes used in CODED UI:

  • Assert
  • StringAssert
  • AssertFailedException
  • AssertInconclusiveException

Assertions is same as validations which helps to verify if the actual output is same as expected output.

Below are some important classes used in Coded UI:

14.

How To Access The New Ui Map Controls From Another Cs File?

Answer»

Using Get and Set properties we can ACCESS the NEW UI Map controls in ANOTHER CS files. Below the SAMPLE code.

public UIMap UIMap

{

get

{

if ((this.map == null))

{

this.map = new UIMap();

}

return this.map;

}

}

private UIMap map;

Using Get and Set properties we can access the new UI Map controls in another cs files. Below the sample code.

public UIMap UIMap

{

get

{

if ((this.map == null))

{

this.map = new UIMap();

}

return this.map;

}

}

private UIMap map;

15.

How Many Ui Maps Can Be Created In Coded Ui?

Answer»

Any NUMBER of UIMaps can be CREATED in CODED UI.

Any number of UIMaps can be created in Coded UI.

16.

What Are Search Properties And Filter Properties?

Answer»

SEARCH Properties are Mandatory (PRIMARY) Properties which perform AND operation

FILTER Properties are SECONDARY properties which perform OR operation

Search Properties are Mandatory (Primary) Properties which perform AND operation

Filter Properties are Secondary properties which perform OR operation

17.

What Is Alternative Approach To Perform Click Operation(without Mouse.click())?

Answer»

Move the CONTROL on to UI element using Keyboard.SendKeys(“{TAB}”); then use Keyboard.SendKeys(“{ENTER}”); to perform CLICK operation

Move the control on to ui element using Keyboard.SendKeys(“{TAB}”); then use Keyboard.SendKeys(“{ENTER}”); to perform click operation

18.

What Is Approach To Perform Mouse Click Operation?

Answer»

using Click() method we can perform click operation on any CONTROL in Coded UI.

Total there are 10 Click() overload METHODS mentioned below:

  • Mouse.Click();
  • Mouse.Click(ModifierKeys modifierKeys);
  • Mouse.Click(MouseButtons BUTTON);
  • Mouse.Click(POINT screenCoordinate);
  • Mouse.Click(UITestControl control);
  • Mouse.Click(UITestControl control, ModifierKeys modifierKeys);
  • Mouse.Click(UITestControl control, MouseButtons button);
  • Mouse.Click(UITestControl control, Point relativeCoordinate);
  • Mouse.Click(MouseButtons button, ModifierKeys modifierKeys, Point screenCoordinate);
  • Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate);

using Click() method we can perform click operation on any control in Coded UI.

Total there are 10 Click() overload methods mentioned below:

19.

What Is Attribute Coded Ui? And Give Some List Of Attributes?

Answer»

[TestMethod] is an attribute before method in class and indicates the method should be executed to PERFORM a test.

[DataSource(…)] is an attribute which is used for Data DRIVEN Testing.

Like wise there are many ATTRIBUTES available in Coded UI:

[TestMethod]

[TestCleanup]

[TestInitialize]

[TESTCLASS]

[AssemblyCleanup]

[TestMethod] is an attribute before method in class and indicates the method should be executed to perform a test.

[DataSource(…)] is an attribute which is used for Data Driven Testing.

Like wise there are many attributes available in Coded UI:

[TestMethod]

[TestCleanup]

[TestInitialize]

[TestClass]

[AssemblyCleanup]

20.

What Are Test Initialize And Test Cleanup Coded Ui?

Answer»

Test Initialize ATTRIBUTE is same as TestMethod which EXECUTES before a TestMethod by DEFAULT. BROWSER launch, login functionality will be scripted in Test Initialize.

Test Clean Up attribute is same as TestMethod which executes after a TestMethod by default. Closing the browser, CLEARING cache, clearing cookies and log out functionality will be scripted in Test Clean Up.

Test Initialize attribute is same as TestMethod which executes before a TestMethod by default. Browser launch, login functionality will be scripted in Test Initialize.

Test Clean Up attribute is same as TestMethod which executes after a TestMethod by default. Closing the browser, clearing cache, clearing cookies and log out functionality will be scripted in Test Clean Up.

21.

What Is Test Method In Coded Ui?

Answer»

In CODED UI, 1 TestMethod is same as 1 TEST CASE.

In Coded UI, 1 TestMethod is same as 1 Test case.

22.

What Is The Namespace To Work On Web Controls?

Answer»

Below the NAMESPACE to WORK on WEB CONTROLS in Coded UI

using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;

Below the namespace to work on Web Controls in Coded UI

using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;

23.

What Is The Namespace To Work On Coded Ui Controls?

Answer»

Below the NAMESPACE to WORK on CODED UI:

USING Microsoft.VisualStudio.TestTools.UITesting;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using Microsoft.VisualStudio.TestTools.UITest.Extension;

Below the namespace to work on Coded UI:

using Microsoft.VisualStudio.TestTools.UITesting;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using Microsoft.VisualStudio.TestTools.UITest.Extension;

24.

Explain About Test Builder?

Answer»

Test Builder is a TOOL ACCESSIBLE in Coded UI which contains 4 OPTIONS

  1. Record: is used to record the actions.
  2. Show Recorded STEPS: used to show all the recorded steps.
  3. Cross Hair: is used to recognize the controls and can view the property information of controls.
  4. Generate Code: used to generate the code for the recorded actions.

Test Builder is a tool accessible in Coded UI which contains 4 options

25.

How Controls Will Be Recognized In Coded Ui?

Answer»

There is a tool accessible in Coded UI named Test BUILDER. In this Test Builder there is an option named ‘Cross Hair’, using this cross hair we can RECOGNIZE the controls and can VIEW the property INFORMATION of controls.

There is a tool accessible in Coded UI named Test Builder. In this Test Builder there is an option named ‘Cross Hair’, using this cross hair we can recognize the controls and can view the property information of controls.

26.

How Many Types Of Programming Approaches Available In Coded Ui?

Answer»

3 TYPES of PROGRAMMING available in Coded UI.

  1. Complete DESCRIPTIVE Programming.
  2. Programming using UI MAP.
  3. Recording and Playback.

3 Types of programming available in Coded UI.

27.

How Much % Of Testing Will Be Covered For Automation Testing?

Answer»

In automation TESTING, mostly the below CONDITIONED test cases can only be automated:

  • CRITICAL Scenarios test cases.
  • Repeated test cases.
  • Time consuming test cases.
  • Test cases which are difficult to perform manual test cases.

CONSIDERING the above situations 60-70 % of testing can be covered for automation testing. ALSO height, width and colours of controls in application/software/product can’t be tested.

In automation testing, mostly the below conditioned test cases can only be automated:

Considering the above situations 60-70 % of testing can be covered for automation testing. Also height, width and colours of controls in application/software/product can’t be tested.

28.

Why Going For Coded Ui Automation Testing?

Answer»
  • For Coded UI we can use Visual Studio IDE to write scripts.
  • Coded UI scripts can be executed using Visual Studio or by using Microsoft Test Manager (MTM).
  • For Coded UI we can write the SCRIPT with Visual Studio with which we can use all object programming concepts if required.
  • Coded UI supports windows APPLICATIONS, web applications, WPF applications, Sharepoint applications, CLIENT applications and CRM web client applications.
  • Coded UI offers support to any information source managed by .NET framework. Coded UI supports file formats of .csv, .xml or information sources LIKE SQL server table, access table etc.

29.

What Is Automation Testing?

Answer»

Automation Testing is a process where tester writes the scripts USING automation TOOL and execute the scripts to TEST the product/Software/application by comparing the actual RESULTS with expected results.

Automation Testing is a process where tester writes the scripts using automation tool and execute the scripts to test the product/Software/application by comparing the actual results with expected results.