Posts

Creating a Build pipeline with Telerik Test Studio Free framework and TFS 2017 and above

Image
My earlier posts were about how to create a test in visual studio with Telerik Framework. Since now you have couple of tests. lets take it to the next level. First add your test code to a online repository ex: GIT When the test suite is checked in to GIT leave the rest to TFS, you will need a another machine to run th tests, a Server or a PC in the same network would work for this Follow the below steps 1. Open TFS 2. Click on builds and release 3. Click on New button 4. Add a name to your build and save 5. Add steps to your deployment process 6. Run the tests its that simple, Lets look in to adding steps to the build process, Since you created your tests in visual studio this would be an easy process. Please refer the below steps to add tasks to the build process 1. Add a task to get sources Add a Get Sources task first now add your properties 2. Build your solution add a visual studio build task next add your solution details in proper...

Create a Test Order for Telerik Automated tests

Image
This post will cover how to run your tests in a order, as now you have many tests, there can be tests that have priorities so that some of the tests in your test suite should be run first because there can be tests that are depending on the prioritized tests. If you have missed the post how to create tests using Telerik testing framework Click Here So lets check how to create a test order Right click on your project and select add > new item From Tests node you can select ordered test  as shown in Figure 1 Figure 1 You can Name your test Ex: OrderdTest1 and add it to the project Once thats done, your Test will be listed in the ordered test, So you can pick then and select the test you want to run as your prioritized order. You dont have to add all your tests for this if you dont want to run all your tests in this list Ex: you have created tests for a system test and if you want to create a test for smoke test, you can just create a ordered list with just few t...

Using page object model with Telerik Framework

Image
In this blog we are going to talk about how to use Page Object Model to arrange your page UI elements in your test. Page object Model is a design pattern used  to create  Object Repository  for web UI elements  in test automation. Page object Model is used heavily in selenium but its is a good practice to use it in Telerik framework because we don't get a pre populated DOM  like in Telerik test studio. Actually we are using a modified Page Object Model in here, Lets take a login scenario as an example Login Page With out using Page object model the login script will look like this HtmlInputText Uname = myManager.ActiveBrowser.Find.ById("username").As<HtmlInputText>(); HtmlInputText Pass = myManager.ActiveBrowser.Find.ById("password").As<HtmlInputText>(); HtmlInputButton login = myManager.ActiveBrowser.Find.ById("loginbutton").As<HtmlInputButton>(); myManager.ActiveBrowser.Actions.SetText(Uname, "User...

Sheduling tests - Running Tests From the Command line | Telerik Testing Framework

Image
Telerik test studio   Has its own test scheduler so you can schedule tests from the Telerik IDE itself, but what if you're using there Free framework? Telerik Testing Framework Scheduling can be done using couple of methods, If you have Team foundation server  (TFS) you can create a CI module for this can if you have Microsoft Test Manager you can schedule and run the tests. If you don't have any of those tools but if you still want to schedule and run your tests this is a very simple method you can use. Just follow the below steps Step 1: Add a test settings file. Right click on your visual studio solution select Add > New Item Select Test settings Tab on the right and click on  Test Settings File to your project [Figure 1] Figure 1 No need to add or change any properties in the Test Settings file at the moment, just close it Build your solution Step 2 Create a text file, you can use notepad or Notepad++ for this task Copy the b...

Handling dynamic IDs from Telerik framework

Usually in automation there is a golden rule not to automate changing requirements that is because if you do that  the ROI that you are gaining from your automation suite is very little. but what if your elements in your automation application is changing?  Are you not going to automate it? The answer is NO!! If you are automating an application with dynamic ID generation look very closely at the changing IDs. If you check one element from different browsers you will see that there is always a static part  for the IDs but a dynamic part is added to the static ID to generate an unique ID to the element. This could happen if you're automating an application which uses a mechanism to generate webpages like Episever, Sitecore, Crownpeak, Kentico. In all these systems there is a underlined webpage generation method so this might generate elements with dynamic IDs Example: Imagine your login button has a dynamic ID :  relateLoginbtn_Ctl012 if yo...

Drag and Drop with Telerik Testing Framework

Posting a blog after a long time, so I'm not gonna add a huge description here. Most of the user friendly web applications support drag and drop commands/actions and even though lot of test automation IDEs support drag and drop its dosent work most of the time, Trust me I have tired. So on today's post we will discuss how to perform this simple task using Telerik Test studio Step 1 First you have to identify which are the two elements you're going to use for this operation Eg: I'm using 2 HTML div Elements ids: dragitem, droptiem Since you're using a code first method first you have to identify the 2 elements in the web browser HtmlDiv Dragitemspan = ActiveBrowser.Find.ById("dragitem").As<HtmlDiv>(); HtmlDiv dropitemspan= myManager.ActiveBrowser.Find.ById("dropitem").As<HtmlDiv>(); This is the vary basic method of identifying an element in Telerik test studio, you could use page object class or a pag...

How to take screenshots of a failed test with Telerik Testing Framework

Image
This article is about taking a screenshot with Telerik Test Studio Free Framework. If you want to know how to write tests with Telerik Test Studio Free Framework refer my Previous posts Lets Start, First you need a test clean up method, If you're using a VS test Project given from Telerik testing framework its already on your VS test template like in the below screenshot [Figure 1], else you can create a new test method. Figure 1 If you're creating a new Cleanup test method, follow the below syntax // Use TestCleanup to run code after each test has run [TestCleanup()] public void MyTestCleanup() { // // Place any additional cleanup here // #region WebAii CleanUp // Shuts down WebAii manager and closes all browsers currently running // after each test. This call is ignored if recycleBrowser is set this.CleanUp(); #endregion } This is copied from the Telerik Fre...