Omar AL Zabir blog on ASP.NET Ajax and .NET 3.5

Working hard to enrich millions of peoples' lives

Sponsors

News

I am
Co-Founder and CTO of Pageflakes, acquired by LiveUniverse - founded by MySpace founder.

My Public Page
www.pageflakes.com/omar

View Omar AL Zabir's profile on LinkedIn

Read my blog on:

Omar AL Zabir

www.oazabir.com



Views:

Articles

Open source projects

June 2009 - Posts

MSDN Day @ Dhaka

Venue.
IDB Auditorium
E/8-A Rokeya Sharani,
Sher-e-Bangla Nagar,
Agargaon, Dhaka 1207

Saturday June 20th 9:00 AM to 6:00 PM

Microsoft Community in Bangladesh proudly presents Microsoft Day @ Dhaka. This is a special day dedicated to all Microsoft technology professionals and students in Bangladesh. We will be having the best Microsoft community technologists from Bangladesh - Microsoft Most Valuable Professionals (MVPs) delivering sessions at the event. This technology marathon is a great opportunity to learn from the best and network with each other.
Both Microsoft developers and networking professionals would find the event worth attending.
The event will also feature a demo bonanza with Windows 7 and an extensive Question and Answer panel with the Bangladesh MVPs to answer your queries.

http://msdnbangladesh.net/content/msday.aspx

Please register soon! Limited sits. I have a session there as well.

 

AUDITORIUM – Dev Track

9:00 - 9:30: Opening Speech - Feroz Mahmood

9:30 - 10:30: Development in ASP.NET [LINQ, Web Forms, Dynamic Data] - Tanzim Saqib

10:30 - 11:15: My First ASP.NET MVC App - Mehfuz Hossain

11:15 - 11:45 : Unit Testing in MVC and Demo of dotnetshoutouts.com - Kazi Manzur Rashid

11:45- 12:30: Developing in Silverlight - Faisal Hossain Khan

12:30 - 1:30: Lunch

1:30 - 2:00 : Introduction to Sharepoint/ MOSS - Jannatul Ferdous

2:00 - 2:45: Production Challenges of ASP.NET Websites - Omar Al Zabir

2:45 - 3:15: Windows Azure - Ashic

3:15 - 3:45: Tea Break

3:45 - 4:30:  Overview of Visual Studio Team System 2010 - Mohammad Ashraful Alam

4:30 - 5:30:   Features of Windows 7 - IE8 and Windows Live Features - Omi Azad

BREAK OUT – IT Pro Track

9:00 - 9:30: Opening Speech - Feroz Mahmood [IN AUDITORIUM]

9:30 – 10:30: Exchange Server 2010

10:30 - 11:30: Windows Server 2008 - Virtualisation & HyperV

11:30 - 12:30: Talking Windows Server 2008 and R2 [Windows Client & Windows Server 2008 NAP – Better Together] - Anwar Hossain (Technical Specialist, MS Bangladesh)

12:30 - 1:30: Lunch

1:30 - 2:15:  Session on MS Project & EPM : M. Manzurur Rahman (CEO, ICT Alliance)

2:15 - 3:00: Office 2007

3:00 - 3:30: Tea Break

3:30 - 4:30:  Introduction to SQL Server 2008

4:30 - 5:30:   Features of Windows 7 - IE8 and Windows Live Features - Omi Azad [IN AUDITORIUM]

DotNetKicks Image
Posted: Jun 17 2009, 03:52 PM by oazabir | with no comments
Filed under: , ,
ASP.NET AJAX testing made easy using Visual Studio 2008 Web Test

Visual Studio 2008 comes with rich Web Testing support, but it’s not rich enough to test highly dynamic AJAX websites where the page content is generated dynamically from database and the same page output changes very frequently based on some external data source e.g. RSS feed. Although you can use the Web Test Record feature to record some browser actions by running a real browser and then play it back. But if the page that you are testing changes everytime you visit the page, then your recorded tests no longer work as expected. The problem with recorded Web Test is that it stores the generated ASP.NET Control ID, Form field names inside the test. If the page is no longer producing the same ASP.NET Control ID or same Form fields, then the recorded test no longer works. A very simple example is in VS Web Test, you can say “click the button with ID ctrl00_UpdatePanel003_SubmitButton002”, but you cannot say “click the 2nd Submit button inside the third UpdatePanel”. Another key limitation is in Web Tests, you cannot address Controls using the Server side Control ID like “SubmitButton”. You have to always use the generated Client ID which is something weird like “ctrl_00_SomeControl001_SubmitButton”. Moreover, if you are making AJAX calls where certain call returns some JSON or updates some UpdatePanel and then based on the server returned response, you want to make further AJAX calls or post the refreshed UpdatePanel, then recorded tests don’t work properly. You *do* have the option to write the tests hand coded and write code to handle such scenario but it’s pretty difficult to write hand coded tests when you are using UpdatePanels because you have to keep track of the page viewstates, form hidden variables etc across async post backs. So, I have built a library that makes it significantly easier to test dynamic AJAX websites and UpdatePanel rich web pages. There are several ExtractionRule and ValidationRule available in the library which makes testing Cookies, Response Headers, JSON output, discovering all UpdatePanel in a page, finding controls in the response body, finding controls inside some UpdatePanel all very easy.

First, let me give you an example of what can be tested using this library. My open source project Dropthings produces a Web 2.0 Start Page where the page is composed of widgets.

image

Each widget is composed of two UpdatePanel. There’s a header area in each widget which is one UpdatePanel and the body area is another UpdatePanel. Each widget is rendered from database using the unique ID of the widget row, which is an INT IDENTITY. Every page has unique widgets, with unique ASP.NET Control ID. As a result, there’s no way you can record a test and play it back because none of the ASP.NET Control IDs are ever same for the same page on different visits. This is where my library comes to the rescue.

See the web test I did:

image

This test simulates an anonymous user visit. When anonymous user visits Dropthings for the first time, two pages are created with some default widgets. You can also add new widgets on the page, you can drag & drop widgets, you can delete a widget that you don’t like.

This Web Test simulates these behaviors automatically:

  • Visit the homepage
  • Show the widget list which is an UpdatePanel. It checks if the UpdatePanel contains the BBC World widget.
  • Then it clicks on the “Edit” link of the “How to of the day” widget which brings up some options dynamically inside an UpdatePanel. Then it tries to change the Dropdown value inside the UpdatePanel to 10.
  • Adds a new widget from the Widget List. Ensures that the UpdatePanel postback successfully renders the new widget.
  • Deletes the newly added widget and ensures the widget is gone.
  • Logs user out.

If you want to learn details about the project, read my codeproject article:

http://www.codeproject.com/KB/aspnet/aspnetajaxtesting.aspx

Please vote if you find this useful.

DotNetKicks Image
Posted: Jun 14 2009, 12:41 AM by oazabir | with 1 comment(s)
Filed under: , ,
More Posts