Wednesday, September 12, 2012

Refresh a page with Postback and Re-submit the form

In one of the applications, the page was doing a postback on a huge data set and sometimes it used to time-out in the Staging environment. The behavior was seen very rarely in Production environment. The application itself stored the data every 8 seconds in a temp table so there was no loss of data. But, from the automation script perspective, I had to write code to refresh the page and do the post-back again if it failed the first time (see below).


Refresh any page using Webdriver and Click "OK" on the pop-up / alert box:
               
driver.Navigate().Refresh();
driver.SwitchTo().Alert().Accept();

When you refresh the page, you may get the alert box (see picture below) and you will have to accept. The second line of code above does this step.


Now, if you want to re-submit the data, search for the WebElement which does the submit and Click again.

Monday, August 06, 2012

Ubuntu, Compilers and Wireless

I recently started preparing for interviews and wanted to brush up my C++ and Perl skills. I had an old laptop that I had not used in many years. I tried to install Ubuntu but the latest version of Ubuntu was not compatible with my laptop configuration. So, I installed Lubuntu instead and so far it is rocking.

Compilers that I needed where easy to get, you can use the following commands to install all the packages that you want:

sudo apt-get install

For example:

sudo apt-get install g++

sudo apt-get install perl

I did have trouble connecting to my Wireless internet and had to do some special setup. I found the solution in the thread, solution posted by wildmanne39 (response #7):

http://ubuntuforums.org/showthread.php?t=1859446

- download the b43.zip file and drop the file in your Desktop
- Disconnect your wired connection if connected
- Right-click the zip file and select Extract here
- open a terminal and run the following commands-


sudo mkdir /lib/firmware/b43
sudo cp Desktop/b43/*  /lib/firmware/b43
sudo rmmod -f b43
sudo rmmod -f ssb
sudo modprobe b43


Worked like a charm.


Friday, July 20, 2012

Test Automation and Selenium

After trying to write an automation test suite for my companies website using Visual Studio Test tools, I have recently started using Selenium to automate the web tests.

I was really excited when Microsoft came up with their testing tools with their new Visual Studio license way back in 2007. My excitement was short-lived because it was not easy to get past all the issues that you need to troubleshoot to get the web test working and time was a big constraint with the projects. We did not have enough time and resource to spend on writing the automated scripts and when we were ready after the application went live, there were already changes being made to the application functionality. Also, all the application that I was working on were totally data driven which also complicated the automation. Since, the tool was new, I could not find enough articles and documentation to troubleshoot the issues I was facing with VS Test.


One cool thing that I did with VS Load Test was to run a performance test to check the database servers. The SQL 2008 database cluster were storing the transaction data and log data on a ISCSI unit. This is how I did it:


  • First I picked the most intensive query that was being executed in our Production database server. We ran a trace on the Production database over a period of time to identify this query
  • Used this query to write a SQL unit test
  • Designed a load test to call this SQL unit test multiple times and concurrently
  • Monitored the performance of the database servers
We did find one issue by this performance testing. The connection between the database server and the ISCSI unit was defaulted to 100 MBPS and it was actually a 1 Gigps connection. The data was getting choked while writing to the storage unit and we changed the default value to fix this issue.

Automation is cool but if the application is constantly changing and there is not enough time to maintain the automation scripts, it will be better to stick with manual testing.


Now, after contemplating for sometime, I have decided to take the automation route again. Thinking more carefully on what I can automate and what I cannot. I have also started using Selenium to write my automation scripts.


Wish me luck!!

Topics I am interested in.....

Writing a blog post after a very long time. I have learned a lot in the past few years and plan to write my experiences working on the following:

  • LINQ to XML
  • Entity Framework
  • Running code in parallel
  • Test Automation
  • Data Warehouse
  • SQL PIVOT

My current passion is Test Automation, so I am going to start with that.