Visual Studio 2010

Create test list and run tests in nightly builds 

Here is a video link this shows you how to create test list using Visual studio and how to run the tests from command prompt. This can be used to create batch jobs and schedule them with in the build or to run every night.

More…

By Pavandeep Puddupakkam on December 15, 2011 | Visual Studio 2010 | 2 comments
Tags: , , ,

TFS Visual Studio 2010 and Excel Integration TF80070 error – Selenium Excel Test Data 

I am using Excel to store the test data and use Visual Studio 2010 C# to code the selenium scripts. When running the scripts I was getting the TF80070 error. I had to click on the confirmation box to continue testing. So it when from automation testing to manual testing (because of the error message).
Anyway here is the solution.
Open excel and then go to excel options. Select Add-Ins and the from the manage select list select COM Add-ins. From the COM Add-ins uncheck Team Foundation Add-in check box. This will stop the annoying error message from appearing.

Verifying the canonical tag on a web page using Selenium GetLocation 

Here is an example to verify the canonical tag on a web page using Selenium GetLocation. The selenium script is written in C#

public int CheckCanonicalTag()
{
int resultcount = 0;
string URL = selenium.GetLocation();
if (selenium.IsElementPresent("//link[@rel='canonical' and @href='" + System.Web.HttpUtility.UrlDecode(URL) + "']"))
{
Console.WriteLine( "Canonical tags is present on the page :" + URL);
}
else
{
Console.WriteLine( "Canonical tags is not present on the page :" + URL);
resultcount++;
}
return resultcount;
}

More…

Using Selenium in a Ajax web application 

On an Ajax web application or Ajax feature on web page small sections of the page will update and often the entire webpage will not load. It’s necessary to wait until this ajax process is completed before interacting with sections of the page where content or controls are yet to be rendered.

More…

Extracting day,month,year from a datetime variable 

Extracting information from datetime variable.

DateTime d = DateTime.Today;

d.Day -> Extracts the day
d.Month-> Extracts the month
d.Year -> Extracts the year

More…

By Rashmi on September 19, 2011 | Visual Studio 2010 | 1 comment
Tags: , ,

Examples for Split Function 

Split Function can be used to split strings on spaces

string s = "Splitting a string";
string[] words = s.Split(' ');
foreach (string word in words)
{
Console.WriteLine(word);
}

More…

By Rashmi on | Visual Studio 2010 | A comment?
Tags: ,