Wednesday

Test Studio Software Testing Tool by Telerik


Build automated tests for your web and desktop apps. Test HTML5AJAXSilverlight and WPF apps, JavaScript calls, Telerik controls, dynamic page synchronization, client-side behaviors, complex UI virtualizations and elaborate XAML animations. Quickly convert them to performance tests to identify performance robbing bottlenecks.


Automated Testing Videos - Why choose Telerik testing tools


Automated Testing Videos:
Silver Light Automation
Test Execution and Scheduling
Overview
Testing Rad Controls
Advaced Technic















Click Link Here:  http://www.telerik.com/automated-testing-tools/support/videos.aspx

.NET Web Test Automation: Selenium vs. Telerik’s Test Studio





Overview
With agile practices getting more popular Test Automation is important factor in achieving continuous delivery. There are so many tools available in market for test automation. It includes both Open Source and Proprietary Tools/Framework. It’s very challenging as well as interesting to pick up best tool for your test automation. Many times I have seen people choosing Open Source tools just because they are free. On the other hand it also true that most of the proprietary products are very costly. It was also challenging for me to come up with best tool for Test Automation for my project which included applications in ASP.NET and WPF.
In today’s post, I would more talk about Web Test Automation and try to compare well known open source framework “Selenium” (http://seleniumhq.org/) and proprietary tool “Test Studio” from Telerik (http://www.telerik.com/automated-testing-tools.aspx). The prior one is framework using which we need to create whole sort of test script by writing code while later one is product with nice UI. Somebody might say why I am doing comparison of open source framework with a proprietary product? The answer is – ultimate we have to come up with solution that satisfies my “requirement”. So before going ahead I have to clarify my or project’s requirement. Solution should provide:
Automation of Web Application (as of now just considering ASP.NET application for ease of analysis).Test support on Internet Explorer, Firefox, Chrome and Safari
Less learning curve as my resources would be from Testing team and may not coding expert
Better productivity for creating new scripts so that it would not increase much cost for new enhancements.Better Reporting feature for easy analysis of failure scenarios
Ease of Maintenance.Overall Test Script creation and execution and maintenance cost (initial + resource) should be less.
Analysis.The first two requirements are straight forward. Both tools in context (Selenium and Test Studio) satisfy this.
The later ones are more subjective and many vary from project to project. Let’s discuss these in details one by one.Learning Curve
Selenium – To work with frameworks that mainly require script coding, developer should have knowledge of both script coding as well as test case development. This increases learning curve for script developer. Also without powerful UI support, developer need to rely on trial and error to find out bugs in script itself. I must mention here that Selenium has very good support from community and that is very useful.
Test Studio – It provides nice UI that helps person self-learning the tool. It also provides multiple views by which you can carry out your work. One can learn usage of Test Studio by view various videos available on Telerik site. Also you can ask for any help from support team.
Resource Productivity
Here I would like analyse ease of development of a complex test script by average skilled user.
Selenium – It has very good apis and skilled resource can develop script with better productivity. The usage of IDE in Firefox is limited. So for any test case one has to do sufficient coding exercise.  The coding itself is bound to follow its coding life cycle including debugging and sanity testing. Reading just steps as a story board is difficult in selenium.  Handling of timeouts, AJAX calls are the areas where developer can make easy mistakes. So quality of script will more dependent on experience of developer in selenium.
Test Studio – It provides complete UI based script capturing as well as modifications to script test. You can easily see story board that gives you better idea about your test case and steps followed in the same. Tool provides various UI based options for capturing element, comparing values against required properties. You can easily add data driven testing without much effort. Even logical and looping conditions can be easily incorporated using UI. Capturing of mouse and java script event is UI based. This gives lot of relief to developer and person can concentrate on Test Case logic or Business validation planning rather than coding or development. UI provides high speed in capturing element, comparing the required values and verifying the output. This is biggest advantage of Test Studio.
Ease of Maintenance
It’s an important factor where you have large number of test cases.
Selenium – People find it difficult to manage test scripts than creation. For small change also it might need to recapture whole script. It requires lot of planning for large scale project to use selenium effectively in there project. Tester needs to do debugging and find out where it’s an application failure or it’s a script issue. Many times dedicated effort has to be given to keep pace with changes incurring in agile sprints. 
Test Studio – Here Test Studio has upper hand. One can create modular test cases and reuse them in various test scenarios as and when required. It provides detailed failure log that includes images of failed step and expected step. So just by viewing image one can easily do initial analysis and decide whether script to be modified or bug to be raised for application issue. Steps list and Storyboard help even new developer to understand test case better way and one can do modification easily to the same.
Overall Cost
Let’s try to put together cost statics for say 500 test cases. The productivity of 3-4 test cases per day can be achieved for Selenium while we can consider around 6-7 test cases for Test Studio. I personally believe we can achieve much more than 7 with Test Studio. Let’s assume 20 test cases need to be modified or created for code changes per month that includes modification and enhancements to system.
Item
Selenium
Test Studio
License Cost
$0
$2500
New Script Development Effort with low productivity
167 PD (3 cases per day)
83 PD (6 cases per day)
New Script Development Effort with better productivity
125 PD (4 cases per day)
72 PD (7 cases per day)
Script change effort per month
70% change & 30% new
4-5 PD
2-3 PD
One Year Maintenance effort
50-60 PD
25-35 PD
So from long term perspective and with increase in no. Of test cases Test Studio not only pays you off initial cost but also saves the overall cost. 
Other benefit of using Test Studio
WPF & Silverlight
Test Studio support WPF and Silverlight application test automation.
Manual Script customization
The Test Studio generates code behind the scene which is based on Telerik Testing Framework i.e. Similar to codedui framework of Microsoft. This gives additional flexibility to developer it he/she at all need to write done manual scripts.
Performance Testing
The upcoming version (2011 R2) of Test Studio includes Performance testing with In-Depth analysis for .NET applications. I am eagerly waiting for this release.

Comparison Table
Below is the detailed comparison between Selenium and Test Studio:
Item
Selenium
Telerik Test Studio
IDE / Script Capture
Firefox 3+
Firefox 2+, IE 7+, Safari 5+, Chrome 7+
Run Test supported Browsers
Firefox 3+, IE 7+, Safari 2+, Opera 8+

Chrome doesn’t have support as of now
Firefox 2+, IE 7+, Safari 5+, Chrome 7+
Script Development
Firefox IDE + Manual coding
Good API collection. But resource must be skilled in API

Manual coding is more time consuming and error prone
Testing of script itself is required
Complex cases mostly done using manual coding
Well-designed UI that can help capture all types of scripts
Codebase gets generated at background for customization if required
Complex cases can also be captured with ease using UI
Supported OS
Windows, OS X, Linux, Solaris
Windows
Browser Objects Recognition
Good object recognition. Objects can be identified by name, ID or located by using xpath.

Complex elements are not easy to capture
Time consuming
Very Rich UI based object identification
Easy identification  of html element, DOM member
Provides easy way to identify element from hierarchical view
Supports mouse action, drag and drop events Support java script events of control
Recording and Playback
Supported in Firefox
Supported in Firefox, IE, Safari, Chrome
Capture once & Run for all browsers
Supported
Supported
AJAX & jquery
Supported
Supported
Java Script Alerts / Dialog
Supported
Supported
Code Generation Language
Java, C#, Ruby, Perl, PHP
C#.
Language knowledge is not mandatory. UI based application
Data Driven Testing
Supported
Need to plug in custom code for reading data from store
Supports multiple data stores like flat file, in build table, database, excel etc.
Easy to add / modify data in data store
Test Results Reports
Reporting is supported through the test runner and various logs, screen shots can also be captured.

Default Reporting is not rich
Very Rich image based reporting.
Step story board or failure step comparison with image is available
Performance Testing
Not supported
Supported in 2011 R2 getting release by end of Sep 2011.
Support In-Depth details with .NET profiler for .NET application
Price
Free
$2500

Conclusion
We analysed Selenium and Test Studio for our requirement. The Test Studio provides better value if we do cost benefit analysis.
The projects that are being executed on Windows environment and if you are thinking of using open source framework like Selenium or watir for cost saving, then you should try Test Studio before final decision. Even for web sites that are developed in Java or PHP can take benefit of Test Studio as Web Testing is based on HTML and browser. 

Sunday

Data driven for External datasource

Note: When adding an external data file to your project, a copy of that file is placed in your project's Data folder. This is from where the file is accessed and any changes to the file should be made to the file in this location

The default path in Windows 7 is:

C:\Users\User\Documents\Test Studio Projects\Project Name\Data
Jump to the following sections:
Excel spreadsheet
XML file
CSV file
Database source


It is important to note that the entries in the first row of the Excel spreadsheet are used as the column names when attaching columns to the inputs.




From Project tab=====รจClick Add ====รจselect Excel file





Enter the path to your Excel file or click the "..." button to browse and select it. Click "OK" to save this data source definition

Click ok button====รจDouble Click on Test===and execute

Add an XML file

<Automationtesting>

<Inforica>
<Name>UserName</Name>
<value>sudeep</value>
</Inforica>
<Inforica>
<Name>Password</Name>
<value>inforicaHyd</value>
</Inforica>
</Automationtesting>






."Search" is the equivalent of an Excel "Sheet." "UserName" and "Password" translate as the column names. Use $(UserName) and $(Password) to data bind the applicable properties.




After Click ok button===And Execute 

Add a CSV file


CSV files can be created in any spreadsheet application or directly in Notepad if you follow the *.csv formatting conventions (each line with comma separated values, the same number of commas in each line).


Add a Database source



Adding a database source is different than adding an Excel spreadsheet, CSV, or XML file. When you select Database in the "Create new data source" dialog, you have a number of new options you need to specify in order to define your database connection.
  • Provider - in this drop-down, select which database provider to use to access your database. The list that is displayed here depends on which providers have been installed on your computer. You should contact your database administrator if you are not sure what to select.
  • Connection string - enter a valid connection string that is supplied to the selected Provider. The connection string instructs the provider the details on how to connect to your database.
  • Test - click this button to test the connection to your database. A dialog indicating success will display if Test Studio makes a connection.
  • Friendly Name - enter a name to represent this database connection definition


Enter  the data string

Saturday

How to Write a code Using C# or VB.NET in Teststudio

C# or VB.NET in Test studio


Telerik Test Studio supports code behind files. This allows you to write code and have it executed as a test step. It is for scenarios that require a test step that is more complex than what can be composed with the Verification Builder or the actions provided by the Element Menu.


1.Standalone version: click the "Script Step" button in the "Add" ribbon.

2. Once you have created a coded step, click the "View Class" button to see the entire code behind file.

3.Launch New IE browser and Add elements(objects) with "ADD to Project element" button pane with test studio and click 
4.Element is automatically added to element menu
5.After start writing a code



1. how to launch the application
activebrowser. Navigate To("www.Inforica.com")


2. 'How to set the textboxs in text
syntax:  pages. page name. object name.text.text ="ahamad"
example: Pages.WelcomeToFacebookLogIn.RegPasswdPassword.Text = "1234567"


3.How to parametrization(data driven) username and password(Text Boxes)
syntax:pages.page name.object name.text.text = C Type(System.Convert. ChangeType(Data("row name"), GetType(String)),String)
example:Pages.WelcomeToFacebookLogIn. Username.Text.text = CType(System.Convert.ChangeType(Data("UN"), GetType(String)),String)

example:Pages.WelcomeToFacebookLogIn. Password Text.Text = CType(System.Convert.ChangeType(Data("PWD"), Get Type(String)),String)



4.Data driven for drop downs
1. properties by value
syntax:Pages.page name. Object Name.SelectByValue("21", true)
example: pages.SignUpForFacebook.BirthdayYearSelect.SelectByValue(CType(System.Convert.ChangeType(Data("Year"), GetType(String)),String))
2. Properties by text
suntax:Pages.page name. Object Name.SelectByText("21", true)
example: pages.SignUpForFacebook.BirthdayYearSelect.SelectByText(CType(System.Convert.ChangeType(Data("Year"), GetType(String)),String))
2. Properties by Index
suntax:Pages.page name. Object Name.SelectByIndex("21", true)
example: pages.SignUpForFacebook.BirthdayYearSelect.SelectByIndex(CType(System.Convert.ChangeType(Data("Year"), GetType(String)),String))


5.data driven for check box check and unchecked 
syntax:Pages.page name. Object Name.Check(true, true)  'if want unchecked mention as false
 example:Pages.RegistrationTelerik.PageContentUsercontrolsPublicClientnetClientregistrationAscx1RptSubscriptionsInvitationCkSubscriptionCheckBox1.Check(true, true)
datadriven:Pages.RegistrationTelerik.PageContentUsercontrolsPublicClientnetClientregistrationAscx1RptSubscriptionsInvitationCkSubscriptionCheckBox.Check(CType(System.Convert.ChangeType(Data("check"), GetType(Boolean)),Boolean), true)



6. Data driven for radio button
IF Data("text")=1 THEN
Coded step Male or Female Radio button.click
ELSE
Coded step Male or Female Radio button.click
END IF 
syntax:Pages.Page name.Object name. Men Radio.Check(true, true)
example:Pages.TryitEditorV14. Frame View. Men Radio.Check(CType(System.Convert. Change Type(Data("check"), GetType(Boolean)),Boolean), true)

7.Verification for expected data and actual data
syntax:Pages.GoogleAccounts.GoogleAccountsImage.AssertAttribute().Value("alt", ArtOfTest.Common.StringCompareType.Contains, "Google Accounts")
 data driven for Expected data:
 Pages.GoogleAccounts.GoogleAccountsImage.AssertAttribute().Value(CType(System.Convert.ChangeType(Data("name"), GetType(String)),String), ArtOfTest.Common.StringCompareType.Contains, "Google Accounts")
'desktop Element for right Click 


8.'Desktop command: Left Click on A1Link
Dim A1Link As HtmlAnchor = Pages.TelerikCorporationAbout.A1Link
A1Link.Wait.ForExists(10000)
A1Link.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
A1Link.MouseClick(ArtOfTest.WebAii.Core.MouseClickType.LeftClick, 0, 0, ArtOfTest.Common.OffsetReference. Absolute Center)
'Desktop command: RightClick on A1Link
Dim A1Link As HtmlAnchor = Pages.TelerikCorporationAbout.A1Link
A1Link.Wait.ForExists(10000)
A1Link.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
A1Link.MouseClick(ArtOfTest.WebAii.Core.MouseClickType.RightClick, 0, 0, ArtOfTest.Common.OffsetReference.AbsoluteCenter)


'9.if want to user for annotation for each execution frame
Manager.Settings.AnnotateExecution = True
activebrowser.NavigateTo("http://www.telerik.com")


10.'This scenario is used to "Entire Script execution speed" i.e "Execution delay"
Syntax: browser.settings. Execution delay ="M seconds"  
Example:
Manager.Settings.AnnotateExecution = True
manager.Settings.ExecutionDelay="400"
activebrowser.NavigateTo("http://www.telerik.com")
pages.NETUIControlsReporting0.YourAccountTmUsercontrolsPublicClientnetLoginnameandstatusAscx1BtnLoginSubmit.Click
pages.ClientLogIn.SectionContentUsercontrolsPublicClientnetSigninformAscx5LoginFormUserNameText.Text="test"


11.This method is used to "moused speed"
syntax:manager.setting.SimulatedMouseMoveSpeed= m sec\pixels
Example:manager.Settings.SimulatedMouseMoveSpeed="0.1"


12. Execution wait time for each element
system.threading.thread.sleep("2000")


13.This method choose the different browser execution
'Manager.Settings.DefaultBrowser = BrowserType.Chrome


14. This method is used to create log files
'manager.Settings.EnableScriptLogging="True"
'manager.Settings.CreateLogFile="True"
'manager.Settings.LogLocation="C:\ahamad"


15. This method is used Capture the browser
'Manager.Log.CaptureBrowser(Manager. Active Browser)


16.This method is used to "Client ready time out" 'i.e 
manager.Settings.ClientReadyTimeout="20000" 'M sec


17.'This method is used to close the any browser automatically
ActiveBrowser.Close() 


18.This method is used to maximize the browser
Activebrowser.Window.Maximize


19.This method is used to minimize the browser
Activebrowser.Window.Minimize


20.Performing your own Annotation
manager.Settings.ExecutionDelay="400"
activebrowser.Annotator.Annotate("Enter the url")
activebrowser.NavigateTo("http://google.co.in")
activebrowser.Annotator.Annotate("CLICK GMAIL LINK")
pages.Google.GmailSpan.Click
activebrowser.Annotator.Annotate("CLICK A CREATE NEW ACCOUNT LINK")
pages.GmailEmailFromGoogle.LinkSignupLink.Click

21.The following method is use to check the whether object is exist or not in page
EXISTMethod :- Pages.TrainingCrestLeadership.ContentPlaceHolder1Login1UserNameText.Wait.ForExists(10000)


22.Enter press
no need add the element in keyboard press .take the Element in before added object
ActiveBrowser.ContentWindow.SetFocus            Pages.RegistrationTelerik.PageContentUsercontrolsPublicClientnetClientregistrationAscx1TxtPhoneText.ScrollToVisible            Pages.RegistrationTelerik.PageContentUsercontrolsPublicClientnetClientregistrationAscx1TxtPhoneText.Focus           ActiveBrowser.Manager.Desktop.KeyBoard.KeyPress(ArtOfTest.WebAii.Win32.KeyBoard.KeysFromString("Enter"), 150, 1)
ActiveBrowser.WaitUntilReady

23.Launch Empty Note pad file or any Exe File

Dim notePad As New System.Diagnostics.Process()
        notePad.StartInfo.FileName = "notepad.exe"
        notePad.StartInfo.Arguments = "D:\myText.txt"
        notePad.Start()

24.Click Simulate Real Click 
based on the element is top position or button position and use the 

Click 'Objectname
ActiveBrowser.Window.SetFocus
Pages.pagename1.Elementname.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
Pages.pagename1.Elementname1.MouseClick

25.Click Simulate Real tying

Pages.pagename1.Elementname1.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop)
ActiveBrowser.Window.SetFocus
Pages.p
agename1.Elementname1.MouseClick
Manager.Desktop.KeyBoard.TypeText("test", 50, 100)



26.Messagebox
Add DLL:Telerik.window.forms
Messagebox.show("this is urs")




 

How to record a New test & Execute test & Debug

1. Dobble click the new test


2. Click record Option (Ctrl+R



3. Wait for 2 mints internet explorer automatically launching and record pane should display

4. After start recording and once we analyze mode of instances 




6. Enter the URL like www.trainingcrest.in and enter the Username and password

The steps are automatically record in record tab


All the steps are record automatically, when we modify the any steps just click on any and modify



If we change any modification in manually like username and password anything





If we any changes on step like drag and drop 




Click Execute button




After we click execute button .system should automatically execute





When we verify the total log details 


When Step is failed .system should display failed details and log details and failed images expected result and Actual result




Double clicks on failed steps system should display the Step failure window and verify the details and click Image button, verify the Expected result and actual result




Verify the actual image and actual image



If we resolve error .click on resolve failure or Click Element tab and right click on specified element, click Edit element and identify the id or name unique property click ok button


Step 1: Identify the Failure step, Double click and Click element tab ===รจClick Edit element

Step 2: Indetify the property (like specified unique property
Step 3: Click “And button
Step 4: After Verify the specified element
Step 5: click on expert View
Step 6: Click ok button





Twitter Delicious Facebook Digg Stumbleupon Favorites More