Posts

Showing posts with the label coding

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...

Create a simple automation test with Telerik Testing Framework

Image
Automating with Telerik Test Studiois really simple and its free!!!  its just a matter of creating a test in Visual studio and you are set. The following article is about how you create a simple test in Visual studio using Telerik testing framework First of all you should download and install the Telerik Testing Framework, as I said before its free and its a very powerful framework. Use the below link to download Telerik Testing Framework, did I mention that its FREE?? Download Telerik Testing Framework Now install the package, to your computer. Open visual studio Select New project create a Unit test from Visual Studio, If you're using Telerik Test studio Free framework Use Visual studio as your IDE. You could select new project like in the Figure 1 screenshot and select "Unit Test Project" Figure 1 Then Select new Item and Under Test  you can select new VsUnit test from adding a new Item. You can use a Simple Unit test for this but then you...

Create a Data Driven Test with Telerik Testing Framework | Adding the Data file to a Folder

Image
Automating with Telerik Test Studio using data driven testing is simple, its just a matter of clicking on some controls and you are set. IF you need any information regarding that please click on the following link URL:  http://docs.telerik.com/teststudio/features/data-driven-testing/overview But if you're using Telerik Test Studio free framework for your test automation  its not easy as clicking on buttons. But its not that hard. First of all you should create a Unit test from Visual Studio, If you're using Telerik Test studio Free framework Use Visual studio as your IDE. You could select new project like in the Figure 1 screenshot and select "Unit Test Project" Then Select a New VS unit test from adding a new Item. You can use a Simple Unit test for this but then you have to write the initialize and tear down methods by yourself. So use this "VS unit test " option Then you can create a Test Method in that Unit test Your new te...

How to Handle an Upload Dialog via Telerik test studio

How to Handle an Upload Dialog via  Telerik Testing Framework Handling an upload dialog in test automation is quite tricky since the dialog is generated from the browser not the application it self, In Telerik you can record this function but you cannot see the inline code of the function Actually its pretty easy, Here is the code to upload a picture from your telerik automation suite via a upload dialog eg: picture is in C drive C:\\mypicture.jpg Steps 1. Create a variable for the uploaded picture var x = new ArtOfTest.WebAii.Win32.Dialogs.FileUploadDialog (ActiveBrowser,"C:\\mypicture.jpg", DialogButton.OPEN); 2. Initiate the dialog Manager.DialogMonitor.Start(); 3. Close the dialog Manager.DialogMonitor.AddDialog(x); 4. Create an object for the browse button HtmlInputFile choose = ActiveBrowser.Find.ById<HtmlInputFile>("Id of the browse button"); choose.Click(); 5. wait till the upload dialog ...

Handing iframes with Telerik Test studio

Handing iframes with T Telerik Testing Framework Adding content or data to ifrmas is not that hard when using selenium or CoadedUI. All you have to provide is the Xpath of the iframe, but in Telerik test studio its kinda tricky, since it doesn't work with the simple Xpath.  You always have to record that step and the step fails every time you convert it to a C# code. SO following is how you handle a iframe in Telerik test studio with C# code Its advised to use Visual studio when codding with Telerik test studio 1. First create a object/ variable for iframe                                                   ArtOfTest.WebAii.Core.Browser t1_frame = ActiveBrowser.Frames[0]; 2. Locate the text editor's Xpath inside the iframe to a another object Element TextEditor = t1_frame.Find.ByXPath("/html/body"); 3. Use Set...