Thursday, September 10, 2015

Kendo bind local data

                                  Kendo bind local data

Binding data using local data or through http get
























Sunday, September 6, 2015

Validate Http:Post

Validate $HTTP Post using Fiddler

Today I would be talking about validating a Restfull http Post using fiddler.we can validate if the post was successful. 
Steps invloved
  • Open fiddler and specify the Post Url in the composer
  • Specify the action method as Post
  • Create a request body (Data which would be sent)
  • Validate the response message as shown in the snapshot




























Output

Thursday, September 3, 2015

Angular http

                     Using angular for http 

  Using angular it is simple to get JSON data and display it in a view.

Edit in plunker

HTML

Wednesday, September 2, 2015

Angular two way data binding

                       Two way binding in Angular

Today i would show you a simple example of two way binding in Angular.
Note:  
  • Like Knockout we do not need any observable. 
  • Less amount of code
  • When view changes model changes. When model changes view changes. This is known as two way binding


Saturday, August 29, 2015

Introduction to Selenium Web Driver

            Using Selenium Web Driver (Firefox)

Today I would be talking about test automation using Selenium Web Driver. In this article I would be using Firefox
Steps involved
  1. Create a new unit test project in visual studio


 
2. Install Selenium drivers using nugget package manager. We need both package as shown in the snapshot 




3. Write test case as shown below.In this example I am automating a google search for my name.
  
    Steps involved:
  • Load the browser driver : FirefoxDriver
  • Specify the timeout to find the web site :5 sec
  • Specify the website name : http://google.com
  • Find the Id of the search element using Inspect element. In our example we need the Id of the text box in google search ( As shown in the snapshot after the code ) 
  • Enter the text field for search "Prathap Kudupu"
  • Hit Enter button
  • Run the test case

using System;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;

namespace SeleniumTestSamples
{
    [TestClass]
    public class GoogleSearchTest
    {
        private IWebDriver _driver;
        [TestMethod]
        public void GoogleNameSearchChrome()
        {
            try
            {
                _driver = new ChromeDriver();

                _driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMinutes(5));
                _driver.Manage().Window.Position = new Point(0, 0);
                _driver.Manage().Window.Size = new Size(1024, 768);
                _driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
                //Navigate to Google.com
                _driver.Navigate().GoToUrl("http://google.com");
                //Find the Id for entering value
                IWebElement searchElement =
                _driver.FindElement(By.Id("lst-ib"));
                //Pass values 
                searchElement.SendKeys("Prathap Kudupu");
                //Click enter key
                searchElement.SendKeys(Keys.Enter);
            }
            catch
            {
                if (_driver != null)
                {
                    _driver.Quit();
                }
                throw;
            }
        }

        [TestMethod]
        public void GoogleNameSearchFireFox()
        {
            IWebDriver driver = new FirefoxDriver();
            //Keep finding untill time out has been reached
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
            //Navigate to Google.com
            driver.Navigate().GoToUrl("http://google.com");
            //Find the Id for entering value
            IWebElement searchElement=
            driver.FindElement(By.Id("lst-ib"));
            //Pass values 
            searchElement.SendKeys("Prathap Kudupu");
            //Click enter key
            searchElement.SendKeys(Keys.Enter);


        }
    }
}





Find the Id form the web page 






















Run test case from usual studio



Test case results 




  Using Selenium Web Driver (Chrome)

You need to install nuget package for chrome as shown below. This is the only difference.




Visual Studio as administrator

                          Running visual studio as administrator.

Have you wondered why do we need to run visual studio as administrator? 

Here are some good reasons when we need to run visual studio as administrator

  • Installing visual studio
  • Upgrading from trial edition
  • Using post-build events that register a component
  • Debugging applications that run under as different user account such as asp.net web sites
  • Debugging applications that run with elevated permissions
  • Using emulator to debug cloud service product for windows azure
  • Profiling an application
  • Deploying a web application to IIS on a local computer
You can find more information in this MSDN article


How do we run visual studio as administrator?
In the start menu, right click the shortcut for VS and run as administrator.








Tuesday, August 18, 2015

Font Awesome Icon

                                Using font awesome icons

 These are Icons You can place . anywhere using the CSS Prefix fa and the icon's name. Font Awesome is designed to be used with inline elements 
<i class="fa fa-check-circle"></i> fa-camera-retro
 <!DOCTYPE html>  
 <html>  
 <head>  
   <title></title>  
 </head>  
 <body>  
 <h2>JSON Object Creation in JavaScript</h2>  
 <p id="demo"></p>  
 <script>  
   var text = '{"FirstName":"Prathap","LastName":"Kudupu"}';  
   var obj = JSON.parse(text);  
   document.getElementById("demo").innerHTML =  
     obj.FirstName + "<br>" +  
     obj.LastName + "<br>";  
 </script>  
 </body>  
 </html>  

using font awesome icons
  • Paste the following reference into the <head> section of your site's HTML.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"
  • Paste