Tuesday, August 25, 2015

Bootstrap Date Picker with CodedUI Automation [CUIT]

Eliminating Inner Text Properties : CodedUI (CUIT)

Question : CodedUI [CUIT] doesn't work with Bootstrap Date Picker
(http://stackoverflow.com/questions/31801462/codedui-cuit-doesnt-work-with-bootstrap-date-picker)

Solution. :

1. Record Each Click as one test method (for the DateTimePicker)
Once these test methods are recorded, make sure to move each of the test method to UIMap.cs from UIMap.Designer.cs using UIMap.uitest
---------
Navigating back to Months
2. Select the test Method wrote for clicking on the name of the month to navigate back to years - SelectStartDateMonth().
select the 'SelectStartDateMonth' and press F12, which will navigate to UIMap.Designer.cs and will display the below code.

3. Modify the SelectStartDateMonth() in UIMap.Designer.cs as code snippet follows to eliminate the search properties

---------
Navigating back to Year Range
4. Select the test Method wrote for clicking on the name of the year to navigate back to range of years - SelectStartDateYear().
select the 'SelectStartDateYear' and press F12, which will navigate to UIMap.Designer.cs and will display the below code.
5. Modify the SelectStartDateYear() in UIMap.Designer.cs as code snippet follows to eliminate the search properties


---------
Selecting the year from the range 2010-2019
6. Select the test Method wrote for selecting a year - SelectStartDateYearfromYears()
select the 'SelectStartDateYearfromYears()' and press F12. which will navigate to UIMap.Designer.cs as code snippet follows to eliminate the search properties
7. Modify the SelectStartDateYearfromYears() in UIMap.Designer.cs as code snippet follows to eliminate the search properties


--------
Selecting the month from the year
8. Select the test Method wrote for selecting a Month - SelectStartDate_Month()

select the 'SelectStartDate_Month()' and press F12. which will navigate to UIMap.Designer.cs as code snippet follows to eliminate the search properties
9.  Modify the SelectStartDate_Month() in UIMap.Designer.cs as code snippet follows to eliminate the search properties


-----------
Selecting the date from the month
10.Select the test Method wrote for selecting a Date - SelectStatDate_Date()
select the 'SelectStatDate_Date()' and press F12. which will navigate to UIMap.Designer.cs as code snippet follows to eliminate the search properties

11. Modify the SelectStatDate_Date() in UIMap.Designer.cs as code snippet follows to eliminate the search properties

-------



Now the customized date selection run starts.

Recording Steps:-
Initial Stage:



Click 1 : InvokeStartDateField()




Click 3 : SelectStartDateMonth()



Click 4 : SelectStartDateYear()







Click 5 : Selecting the year from the range 2010-2019 : 2011
Click 6 : Selecting the month from the selected year :
Click 6 : Selecting the date from the selected month :

Wednesday, January 7, 2015

What is Unit test, Integration Test, Smoke test, Regression Test?

  • Unit test: Specify and test one point of the contract of single method of a class. This should have a very narrow and well defined scope. Complex dependencies and interactions to the outside world are stubbed or mocked.
  • Integration test: Test the correct inter-operation of multiple subsystems. There is whole spectrum there, from testing integration between two classes, to testing integration with the production environment.
  • Smoke test (aka Sanity check): A simple integration test where we just check that when the system under test is invoked it returns normally and does not blow up. It is an analogy with electronics, where the first test occurs when powering up a circuit: if it smokes, it's bad.
  • Regression test: A test that was written when a bug was fixed. It ensure that this specific bug will not occur again. The full name is "non-regression test". It can also be a test made prior to changing an application to make sure the application provides the same outcome.
To this, I will add:
  • Acceptance test: Test that a feature or use case is correctly implemented. It is similar to an integration test, but with a focus on the use case to provide rather than on the components involved.
  • System test: Test that tests a system as a black box. Dependencies on other systems are often mocked or stubbed during the test (otherwise it would be more of an integration test).
  • Pre-flight check: Tests that are repeated in a production-like environment, to alleviate the 'builds on my machine' syndrome. Often this is realized by doing an acceptance or smoke test in a production like environment\
      
    src : http://stackoverflow.com/questions/520064/what-is-unit-test-integration-test-smoke-test-regression-test