Showing posts with label web application testing. Show all posts
Showing posts with label web application testing. Show all posts

Sunday, August 19, 2012

Frequently Used Selenium Commands


}selenium.start() - Takes you to the location where selenium server is and runs the server.
}selenium.open() - Takes you to the provied URL/Website address.
}selenium.getTitle() - Get the title of the current browser window.
}selenium.windowFocus() - Get the focus on the current window.
}selenium.windowMaximize() - Maximizes the current window.
}selenium.close() - Close the session

Selenium Commands – “Selenese”


ActionsAccessors, and Assertions.
}Actions are commands that generally manipulate the state of the application. They do things like “click this link” and “select that option”. If an Action fails, or has an error, the execution of the current test is stopped.
Øselenium.click("id=gbztms");
Øselenium.select("id=citytravel_city", "label=Bangalore");
}Accessors examine the state of the application and store the results in variables, e.g. “storeTitle”. They are also used to automatically generate Assertions.
ØString Google = selenium.getTitle(); 
Øselenium.type("id=gbqfq", Google);
}Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include “make sure the page title is X” and “verify that this checkbox is checked”.
ØassertTrue(selenium.isElementPresent("id=lga"));
ØassertEquals(selenium.getTitle(), "Google");

Saturday, August 18, 2012

Advantages and Disadvantages of selenium automation tool


Advantages of Selenium

    1. Open Source
    2. Supports all browsers like IE, Firefox, Mozilla, Safari
    3. Supports all Operating Systems.
    4. Supports all programming languages Java,Ruby,C# and Python.
    5. Run multiple tests at a time.

Disadvantages

  1. Identifying the locators that support common attributes like id, names etc as well as XPATH, javascript DOM and others (Use firebug for finding the locators)
  2. Detailed results are not available
  3. Selenium IDE does not supports loop and data driven testing
  4. No Option to verify the images.