Pages

Monday, 19 December 2016

About Author

I am Vardhan, having 10 years of experience in Software Testing, 8 years experience in Automation Testing.
Having experience in QTP/UFT, Coded UI, Selenium functional automation testing tools and Mobile automation testing using Appium. Also having 6 years experience in corporate training.
I am here to share my knowledge/experience to you all through www.software-testng-zone.info
For Training and Enquiries can contact on my mobile/Email.
+91 – 9597100592/vardhancuit@gmail.com

Coded UI Training and On Job Support

For the professionals who just joined in new job and looking for support initially.
For working people who wants to up to date with technology and seeking for growth in their profession.
Online Training on below Automation Testing Tools. 
  1. VSTS Coded UI
  2. Selenium Using C#
  3. Selenium Using Java
  4. Appium Using C# - Mobile Automation Testing
  5. Web Service Testing using SOAP UI
This training is mainly targeted in training on concepts, hands on experience and build confidence in candidate from interview perspective.
On Job Support for Testing Professionals on below Automation Testing Tools.
  1. VSTS Coded UI
  2. Selenium Using C#
  3. Selenium Using Java
  4. Appium Using C# - Mobile Automation Testing
  5. Web Service Testing using SOAP UI
Provide Online IT Training for people in USA, UK, CANADA, INDIA, AUSTRALIA and more countries.

For above Information contact me on
Mobile: +91-9597100592
Email: vardhancuit@gmail.com

Sunday, 18 September 2016

Coded UI Interview Question and Answers

What is Automation Testing?
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.

Why going for Coded UI Automation Testing?
a. For Coded UI we can use Visual Studio IDE to write scripts.
b. Coded UI scripts can be executed using Visual Studio or by using Microsoft Test Manager (MTM).
c. For Coded UI we can write the script with Visual Studio with which we can use all object programming concepts if required.
d. Coded UI supports windows applications, web applications, WPF applications, Sharepoint applications, Client applications and CRM web client applications.
e. 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.

How much % of testing will be covered for Automation testing?
In automation testing, mostly the below conditioned test cases can only be automated:
a. Critical Scenarios test cases.
b. Repeated test cases.
c. Time consuming test cases.
d. 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.

Differences between VS2010, VS2012, 2013 and VS2015 with respect to Coded UI.

How many types of programming approaches available in coded UI?
3 Types of programming available in Coded UI.
a. Complete Descriptive Programming.
b. Programming using UI Map.
c. Recording and Playback

How controls will be recognized in Coded UI?
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.

Explain about Test Builder?
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.
What is the namespace to work on Coded UI controls?
Below the namespace to work on Coded UI
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;

What is the namespace to work on Web Controls?
Below the namespace to work on Web Controls in Coded UI
using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;

What is Test Method in Coded UI?
In Coded UI, 1 TestMethod is same as 1 Test case.

What are Test Initialize and Test Cleanup Coded UI?
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.

What is Attribute Coded UI? And give some list of attributes?
[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]

What is approach to perform mouse click operation?
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);

What is alternative approach to perform click operation(without Mouse.Click())?
Move the control on to ui element using Keyboard.SendKeys("{TAB}"); then use Keyboard.SendKeys("{ENTER}"); to perform click operation.

What are Search Properties and Filter Properties?
Search Properties are Mandatory (Primary) Properties which perform AND operation
Filter Properties are Secondary properties which perform OR operation


How many UI maps can be created in Coded UI?
Any number of UIMaps can be created in Coded UI.

How to access the new UI Map controls from another cs file?
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;

How many types of DDT available on Coded UI?
Data Driven Testing can be done in Coded UI using 5 Data Source types
  1. Using CSV
  2. using XML
  3. using Excel
  4. using SQL (http://software-testing-zone.info/coded-ui/data-driven-testing-using-sql-coded-ui/)
  5. using Test case in TFS
What are the 4 major steps in DDT?
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.
  1. Add the Data Source Attribute.
  2. 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’.

Assertion and Uses?
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
Refer the link http://software-testing-zone.info/coded-ui/assertions-coded-ui/ for complete information of Assertions in Coded UI.

Why we are going assertions instead of If-Else?
When IF-Else is used and if test case fails still Coded UI passes the TestMethod, to overcome this issue Coded UI introduced Assertions.
Refer the link http://software-testing-zone.info/coded-ui/assertions-coded-ui/ for complete information of Assertions in Coded UI.

How many Assertions can be there in a Test Method?
There can be any number on Assertions.
Refer the link http://software-testing-zone.info/coded-ui/assertions-coded-ui/ for complete information of Assertions in Coded UI.

There are 3 Assertions Assert1, Assert2 and Assert3 and if Assert1 fails
Will Assert2 and Assert3 will get execute?
What to do to execute Assert2 and Assert3?
a. Assert2 and Assert3 won’t executes
b. To execute Assert2 and Assert3 use try-catch
Refer the link http://software-testing-zone.info/coded-ui/assertions-coded-ui/ for complete information of Assertions in Coded UI.

Difference between Assert.IsEqual() and Assert.AreSame()
Assert.IsEqual() refers to control value.
Assert.AreSame() refers to reference of the control.
Refer the link http://software-testing-zone.info/coded-ui/assertions-coded-ui/ for complete information of Assertions in Coded UI.

What is Synchronization?
Making sure that the speed of automation scripts execution should be in sync with application under test (AUT) response/speed.

Levels of Synchronization?
Two levels of Synchronization:
1. Test level Synchronization.
2. Statement level Synchronization

What are Conditional Statements in Synchronization?
Statements executes depending on some conditon. In coded UI there are 8 Conditional Statements
WaitForControlReady()
WaitForControlEnabled()
WaitForControlExist()
WaitForControlNotExist()
WaitForControlPropertyEqual()
WaitForControlPropertyNotEqual()
WaitForControlCondition()
WaitForCondition()

What are Unconditional Statements in Synchronization?
Statements executes without any conditon. In coded UI there is 1 Unconditional Statement
Playback.wait()

Explain WaitForControlEnabled, WaitForControlExist and WaitForControlReady
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.

How the Password Encryption done in Coded UI?

What are the class names to launch a browser in web application and launch an application in desktop application?

To launch browser, BrowserWindow class and Launch() method is used.
Sample Code:
BrowserWindow.CurrentBrowser = "ie";
BrowserWindow google = BrowserWindow.Launch("www.google.com");
To launch application, ApplicationUnderTest class and Launch() method is used.
Sample Code:
ApplicationUnderTest calculator = ApplicationUnderTest.Launch(".exe path of calculator");

There are 2 radio buttons, radiobutton1 and radiobutton2 and 
There are 2 buttons button1 and button2
If radiobutton1 is selected then button1 should be clicked
If radiobutton2 is selected then button2 should be clicked
Explain (write) the code?

There is a table as below
Column1S No.NameScoreLocation
Checkbox11Dhoni109Bangalore
Checkbox22Ganguly45Chennai
Checkbox33Sachin63Bangalore
Checkbox44Rohit28Hyderabad
Checkbox55Harbhajan27Chennai
Checkbox66Yuvraj54Hyderabad
Checkbox77Raina72Hyderabad
Checkbox88Kohli7Chennai
Checkbox99Patel21Bangalore
Check the checkbox in column1 where name contains Sachin.

What is Cross Browser testing and how to achieve it in coded UI testing?
What is App.Config and uses?

Difference between Descriptive programming, Using UI Map and Record&Playback.

Advantages and Disadvantages for Descriptive programming

Advantages and Disadvantages for Using UI Map

Advantages and Disadvantages for Record&Playback

What are Ordered Tests and how to create?

How will you manage if unexpected event occurred in your execution flow?

What is MTM?

How to execute the tests from MTM by associating automation and without associating automation?

Explain the Project Structure in Coded UI

What is Mouse Click using coordinates
Mouse.Click(control, new Point(49, 3));
Coded UI will perform click operation exactly on 49,3 point of the control.

Explain about Data Directory
Data Directory means Project Directory/Project folder.

How to launch application from Process?

Explain Playback.PlaybackSettings.ContinueOnError
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;

Explain about reports in Coded UI
Refer to the link http://software-testing-zone.info/coded-ui/reports-coded-ui/


Preparing Unanswered questions... Watch space for the same...


For Training and Enquiries Contact on my Mobile/Email
+91 – 9597100592/vardhancuit@gmail.com

Friday, 16 September 2016

Customized Reports in Coded UI





For Free Demo Call me on Mobile/Email - 9597100592/vardhancuit@gmail.com
You can help yourself with more information from my website www.software-testing-zone.info
If you like the post, comment on the same.

Reports in Coded UI



Reports in Coded UI



For Free Demo Call me on Mobile/Email - 9597100592/vardhancuit@gmail.com
You can help yourself with more information from my website www.software-testing-zone.info
If you like the post, comment on the same.

How not to close the Browser after TestMethod execution





How not to close the Browser after TestMethod execution



For Free Demo Call me on Mobile/Email - 9597100592/vardhancuit@gmail.com
You can help yourself with more information from my website www.software-testing-zone.info

If you like the post, comment on the same.