Create a simple automation test with Telerik Testing Framework
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 have to write the initialize and tear down methods by yourself. So use this "VS unit test " option [Figure 2]
Figure 2 |
So your test will look like below
In your test you could see a template with several test methods such as
MyClassInitialize
MyTestInitialize
MyTestCleanup
MyClassCleanup
You can declare or initialize any variables in the MyClassInitialize
if you're using couple of testes in side one class you can use MyTestInitialize declare or initialize any variables for that particular test
if you have to clean something in each test you can add it on MyTestCleanup
Ex: browser
if you have to clean something at the end of the class you can use MyClassCleanup to clean that variable
Ex: Manager
Then you can create a Test Method in between MyTestInitialize and MyTestCleanup
Your new test methods will look like this
[TestMethod]
public void TestMethod1()
{
}
You can Write your test Scripts inside this method
Eg;
[TestMethod]
public void TestMethod2()
{
Settings mySettings = new Settings();
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
Manager myManager = new Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo("www.google.com");
//Add Some assertion
myManager.Dispose();
}
How to Run the test
In visual studio open the Test menu
Select Test> Windows> Test Explorer
Inside test explorer you new test will be listed if not, build the solution and check the Test Explorer
TestMethod2 will be listed inside the Test Explorer, Right click it and select "Run Selected Tests" or "Debug Selected Tests"
with that your test will start running,
Happy Testing!!!
Very true and inspiring article, I strongly believe all your points. I also learnt a lot from your post. Cheers and thank you for the clear path.
ReplyDeleteBest Selenium Training Institute in Chennai
Selenium training institute in Chennai
Thanks a lot :)
DeleteHi, Excellent Content, your blog is very useful and also interesting to read. Keep sharing this type of information.
ReplyDeleteSoftware testing training in chennai
Testing training in chennai
Thanks a lot :)
DeleteThe article is so informative. This is more helpful for our
ReplyDeleteBest online software testing training course institute in chennai with placement
Best selenium testing online course training in chennai
Learn best software testing online certification course class in chennai with placement
Magento 2 Developer course training institute in chennai
Thanks for sharing.
Thank you very much for the comment
Delete