Monday, July 30, 2012

Last date for filing IT returns is 31-Jul-2011

Even though this post is not relevant to the blog, just adding it as it very useful for those who wants to file thier returns.

Currently there are many paid and free services for filing the returns. Some of the paid services are as follows:
  1. http://www.taxmunshi.com/
  2. http://www.taxspanner.com/
There are various other paid services but I found these to be the lowest Rs. 199 and Rs. 249 respectively.
If you are like me, who is not interested to spend a paisa on the filing the tax return then you have to visit the following site:
https://incometaxindiaefiling.gov.in
First Step: Login to the portal. If you don’t have the log in then register and create your id. It requires your PAN card details so keep them handy. If you don’t have PAN card with you at the moment, then don’t worry. Here is the link which you can access to know your PAN Card details.
Second Step: Download the excel utility or pdf Utility from the following link. For salaried professional download ITR-1. My suggestion would be to download the excel utility.
Third Step: This step requires you to have your Form 16 from your employer. Once you have that with you, you can go ahead with filling the excel utility or pdf utility. I am assuming that excel is what you have downloaded based on my suggestion since it is very easy to fill.
Now in detail, we will go about filling the excel utility.
  1. It is necessary to ENABLE the execution of macros in Return-Preparation-Utility in order to enter, validate and generate an .XML file for upload. Follow these steps to ENABLE execution of macros depending on the version of [Microsoft Office Excel] being used to open the Return-Preparation-Utility.[Microsoft Office Excel 2003] Navigate through the following excel menu option to reduce the level of security in executing macros : Tools –> Macros –> Security
  2. OR
  3. Tools –> Macros –> Security –> Medium
  4. Save the excel-utility and re-open it.
  5. [Microsoft Office Excel 2007] Navigate through the following excel menu options to reduce the level of security in executing macros : Excel Options –> Trust Centre –> Trust Centre Settings –> Macro Settings –> Enable all macros
  6. AND
  7. Excel Options –> Trust Centre –> Trust Centre Settings –> ActiveX Settings –> Enable all controls without restriction and without prompting
  8. Save the excel-utility and re-open it.
  9. [Microsoft Office Excel 2010] When you open the EXCEL-UTILITY, the yellow Message Bar appears with a shield icon and the Enable Content button. Click on the Enable Content to enable the macros.
  10. Fill in your name and address and other details in personal information column.
  11. Clearly mention the ward/circle for filing; since I reside in Bangalore, I have given it as Bangalore Circle. You can find your own from this following link.
  12. In the section Return filed under Section, fill in “11-u/s 139(1)“.
  13. In ” income & deductions” section of the excel sheet, field1 namely, Income from Salary / Pension (Ensure to fill Sch TDS1) can be filled using field 6 in the form 16 namely “Income chargeable under the head ‘Salaries’(3-5)“
  14. If you have a home loan then, Income from one House Property should be filled with Loss From House Property value from your Form 16.
  15. If you have any other Source of income then you have to mention the same in the next row i.e. Income from Other Sources (Ensure to fill Sch TDS2).
  16. Fill the next section namely Dedcutions under Chapter VI A (Section) referring to section with the same name from form16. It is a one to one correspondence between the fields.
  17. Move to next worksheet i.e. TDS, where in you mention the details of your employer as given in Form 16 and also the Income chargeable under the head Salaries will be the amount that is obtained from the First worksheet Row 7. Total Income (4 – 6).
  18. Once that is done, complete the Details of Advance Tax and Self Assessment Tax Payments referring to your Form 16 namely from the ANNEXURE-B section DETAILS OF TAX DEDUCTED AND DEPOSITED IN THE CENTRAL GOVERNMENT ACCOUNT THROUGH CHALLAN.
  19. Lastly fill the Tax paid and Verification worksheet. Once everything is done. Validate the utility by pressing the Validate button. If you have done everything correctly, then there should be no issues. If you have made any error, please correct the same.
  20. Click on Calculate Tax in the first worksheet and Generate Xml file.
Now only two steps are remaining for you to complete the e-filing of the returns.
Once you have generated the XML file, login to the portal. Then in the left, you can find the Submit returns; click the select assessment year, then AY 11 -12. You will land in this page.  Select ITR-1 and say No for digitally signing the file.
Once done, upload the file and voila, it is all done.
You will get an acknowledgment from the IT- Department in your email that you have registered. It should be instantaneous. If you don’t get it in some time, please wait for an hour or so and still if you don’t get the same then my suggestion would be to re-upload the xml file.
Last and important step for filing the income tax returns is as follows:
Since you have not digitally signed the file, you have to send the acknowledgment back to IT office. Please furnish the signed and verified Form ITR-V to the Income-tax Department by mailing it to
Income Tax Department – CPC,
Post Bag No – 1 , Electronic City Post Office, Bangalore – 560100, Karnataka.
Please send it by ORDINARY POST OR SPEEDPOST ONLY within a period of 120 days from the date of transmitting the data electronically.
ITR-V sent by Registered Post or Courier will not be accepted. Form ITR-V shall not be received in any other office of the Income-tax Department or in any other manner.
Once you have sent the ITR-V, you can check the status of the same using the following link.
Hope this helps and please spread the word so that many can benefit from the same. Thank you.

Thursday, July 26, 2012

selenium screenshots using webdriver

Taking Screenshots with Selenium WebDriver

Take a screenshot with Selenium WebDriver

Testers do take screenshots while testing, its important in many ways. So can you take screenshots using Selenium WebDriver? The answer is yes. Below you can find few good links that show you how to take screenshots with Selenium WebDriver:

1. This StackOverflow link has an example from Java, Python, Ruby, Jython [Link]

2. Taking screenshots with Selenium WebDriver (Selenium Client Driver for C#) [Link]

3. Taking screenshot of flash object using Selenium with Webdriver [Link]

4. Taking a Screenshot with Selenium Remote Webdriver - Java, Csharp, Python, Ruby [link]

5. If capture screenshot functionality with remote webdriver implementation throws Class Cast Exception [java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebDriver cannot be cast to org.openqa.selenium.TakesScreenshot], then take a look here.

6. How to take an OS level screen capture using ruby selenium webdriver [Link]

7. How to Take Screenshots during Selenium Test Execution [Link]

Selenium - Uploading a File

Selenium - Uploading a File

If you are trying to upload a file using Selenium and are stuck then below links may help you. Below are 10 links to help you upload a file using Selenium automation testing tool.

1.
Selenium RC with Junit framework - upload a file using attachFile() method - [Link]

2.
Selenium - Uploading Files in Remote WebDriver - [Link]

3.
Selenium - Upload files on browsers running over remote machines [Link]

4.
Selenium: Upload file in Google Chrome - [Link]

5.
How to deal with file uploading in test automation using selenium or webdriver - [Link]

6.
Webdriver: File Upload - [Link]

7.
How to upload a file using Selenium in Java - [Link]

8.
How to upload a file in selenium - AutoIT - [Link]

9.
Selenium RC: How to Upload and Submit Files Using Selenium and AutoIt - [Link]

10.
Selenium Upload/Download file handling - [Link]

Wednesday, July 25, 2012

How to handle popup using Selenium RC?

Handling Popup's using Selenium RC:
 
public void testPopup() throws Exception {
    selenium.open("http://yoursitename/page.jsp");
    selenium.click("//img[@alt='Share']");
    selenium.waitForPopUp("_blank", "30000");
    selenium.selectWindow("windowId");
    verifyTrue(selenium.isTextPresent("Recommend to a friend"));
    selenium.close();
} 

How to locate Web Elements or UI Elements in a page

First of all inorder to locate the web elements we need to open or fetch (open) a web page. We can do this
by
 driver.get("http://www.google.com");


Web Elements:

Locating elements in WebDriver can be done on the WebDriver instance itself or on a WebElement. Each of the language bindings expose a “Find Element” and “Find Elements” method. The first returns a WebElement object otherwise it throws an exception. The latter returns a list of WebElements, it can return an empty list if no DOM elements match the query.
The “Find” methods take a locator or query object called “By”. “By” strategies are listed below.

By ID:
Ex:
< span=""> id="coolestWidgetEvah">... <>
Using Java:  
WebElement element = driver.findElement(By.id("coolestWidgetEvah"));
 



By Class Name:
Ex:
< span=""> class="cheese">Cheddar <>
< span=""> class="cheese">Gouda <>

Using Java:
List<WebElement> cheeses = driver.findElements(By.className("cheese")); 

By Tag Name:

The DOM Tag Name of the element.
Ex

How to handle popups in WebDriver

public boolean testNewWindow(){
 String currentHandle = driver.getWindowHandle();
 Set handles = driver.getWindowHandles();
 handles.remove(currentHandle);
 if (handles.size() > 0) {
 try{
 driver.switchTo().window(handles.iterator().next());
 return true;
 }
 catch(Exception e){
 System.out.println(e.getMessage());
 return false;
 }
 }
 System.out.println("Did not find window");
 return false;
 }

Getting started with WebDriver

package org.openqa.selenium.example;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

public class WebDriverExample  {
    public static void main(String[] args) {
        // Create a new instance of the Firefox driver
        // Notice that the remainder of the code relies on the interface, 
        // not the implementation.
        WebDriver driver = new FirefoxDriver();

        // And now use this to visit Google
        driver.get("http://www.google.com");
        // Alternatively the same thing can be done like this
        // driver.navigate().to("http://www.google.com");

        // Find the text input element by its name
        WebElement element = driver.findElement(By.name("q"));

        // Enter something to search for
        element.sendKeys("Cheese!");

        // Now submit the form. WebDriver will find the form for us from the element
        element.submit();

        // Check the title of the page
        System.out.println("Page title is: " + driver.getTitle());
        
        // Google's search is rendered dynamically with JavaScript.
        // Wait for the page to load, timeout after 10 seconds
        (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
            public Boolean apply(WebDriver d) {
                return d.getTitle().toLowerCase().startsWith("cheese!");
            }
        });

        // Should see: "cheese! - Google Search"
        System.out.println("Page title is: " + driver.getTitle());
        
        //Close the browser
        driver.quit();
    }
}

WebDriver and Selenium Server

You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If you will be only using the WebDriver API you do not need the Selenium-Server. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly.
There are some reasons though to use the Selenium-Server with Selenium-WebDriver.
  • You are using Selenium-Grid to distribute your tests over multiple machines or virtual machines (VMs).
  • You want to connect to a remote machine that has a particular browser version that is not on your current machine.
  • You are not using the Java bindings (i.e. Python, C#, or Ruby) and would like to use HtmlUnit Driver

WebDriver

WebDriver:

WebDriver is a selenium 2.0 and it has all cool features like

1. Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation.
2. Selenium-WebDriver, drives the browser directly using the browser’s built in support for automation.
3. No need to start the server.
4. Works with higher versions of firefox.
5. Android and iPhone based testing.
6. We can do object extraction in Bulk.

WebDriver and Selenium Server:

You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If you will be only using the WebDriver API you do not need the Selenium-Server.. more

Tuesday, July 24, 2012

How to run Firefox 4.0 and higher versions using Selenium RC?

So many of us are facing this problem for a quite long time and unable to run test using selenium RC 1.0.x. The problem behind this is: in the selenium server the max version of firefox to be used is defined as 3.6. To overcome this problem, we need to override the value to the version number you want to use (in my case 4.0). Below are the step on how to do it:
  1. Change the file extension of the selenium-server.jar file to .zip.
  2. Now, extract the file content to any particular folder let’s say ‘selserver’.
  3. Now search for all available install.rdf files. You may get 5-6 such file depending on the version.
  4. Open those files with note pad. In this file you will see a tag like “3.6.*”. As it’s defined as 3.6, hence we need to change it to 4.0 and save the file.
  5. Compress all the files again as you had decompressed them to selenium-server.zip. Change the file extension to .jar.
We are ready with our server with support for Firefox 4.0. Now happy testing using Firefox 4.0 and higher veriosns...  :) .