SELENIUM -WEB TESTING
Selenium first came to life in 2004 when Jason Huggins was testing an internal application at ThoughtWorks.
Thursday, 29 December 2011
How to Accept Self-Signed SSL Certificates in Selenium
Thursday, 22 December 2011
Automation
Automation Tool Selection After the strong analysis and believe of automation will really help for our concern, We have to choose a right automation tool to implement.
Automation Tool Selection
1.Do we need to automate standalone application or client/server application or both?
2.Are we ready to invest some
money to buy a tool or not
3.Do we have the technical persons to train the resource or need any expert from out side
4.Is our existing testing resources capable of adopting the new technology?
5..How is the technical support available for the tool
6.How frequent update is available for the tool to handle the new technology implementation of AUT.
7.Complexity of using the tool.
For Client/Server Application Selenium is my choice to automate my application for various reasons
a. Its Free
b. Its Compatible for many languages so i don't need a different language expert to implement. I can use any language which i am using to develop my application.
c. Its easily maintainable during frequent integration.
What needs to be automated Before we start automation process we should prepare a list for things which has to be automated like below
1. Links
2. Elements
3. Functions
All the above mentioned
items will have some following sub divisions
Links:
a. Inner Link
b. Outer Link
Elements:
a.Visible Elements
b. Hidden Elements.
Functions:
a.Positive Case
b.Negative Case
c.Exceptional Case
Apart from all the above we can automate the Bugs to check for not reproducing again.
Why we need to automate an application? Testing needs more creativity, Logical thinking, Breaking attitude and different point of views. Then only a tester can break 100 developers developed code and catch possible missing of them. So no doubt its 100% manual resource involved work.
So then why we need to automate an application?
Automation is an assistant of a Manual tester to give extra time for think about new sequences rather checking the routine of already developed sequences by them working or not. So never an automation tool can replace a manual tester until the product is dead (no further development ).
Where to Start Automation This is the question i am being asked by many. First thing we should ask and answer for the following Questions with our self.
1. Why we need to automate?
2. What needs to be automated?
3. What is the goal of reducing the time and resource?
4. Is maintainability of automated scripts taking additional time and resource?
Automation Tool Selection
1.Do we need to automate standalone application or client/server application or both?
2.Are we ready to invest some
money to buy a tool or not
3.Do we have the technical persons to train the resource or need any expert from out side
4.Is our existing testing resources capable of adopting the new technology?
5..How is the technical support available for the tool
6.How frequent update is available for the tool to handle the new technology implementation of AUT.
7.Complexity of using the tool.
For Client/Server Application Selenium is my choice to automate my application for various reasons
a. Its Free
b. Its Compatible for many languages so i don't need a different language expert to implement. I can use any language which i am using to develop my application.
c. Its easily maintainable during frequent integration.
1. Links
2. Elements
3. Functions
All the above mentioned
items will have some following sub divisions
Links:
a. Inner Link
b. Outer Link
Elements:
a.Visible Elements
b. Hidden Elements.
Functions:
a.Positive Case
b.Negative Case
c.Exceptional Case
Apart from all the above we can automate the Bugs to check for not reproducing again.
So then why we need to automate an application?
Automation is an assistant of a Manual tester to give extra time for think about new sequences rather checking the routine of already developed sequences by them working or not. So never an automation tool can replace a manual tester until the product is dead (no further development ).
1. Why we need to automate?
2. What needs to be automated?
3. What is the goal of reducing the time and resource?
4. Is maintainability of automated scripts taking additional time and resource?
Sunday, 18 December 2011
Selection of Dymanic Combo Values
There are 2 cases where the Combo Box goes dynamic
1.ComboBox it self is an ajax element
2.The Combovalues gets dynamically populated on some event trigger
Point 1 can be handled using selenium.waitForCondition()
How about point 2 ? Below is the code
static SeleniumServer server;
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
selenium = new DefaultSelenium("localhost", 4444, "*firefox",
"http://www.google.com");
server = new SeleniumServer();
server.start();
selenium.start();
//Click on Google Advanced Search Link
selenium.open("/advanced_search?hl=en");
//Wait Until the Drop appears on the screen
selenium.waitForCondition("selenium.isElementPresent(\"name=num\");",
"15000");
boolean flag = true;
while (flag) {
//Get the count of the drop down values
int optionCount = selenium.getSelectOptions("name=num").length;
// if the dropdown is populated with values, come out of the while
// loop
// else continue looping until the count is > 0
if (optionCount > 0) {
break;
}
continue;
}
//This code will be executed only if dropdown has some values
//else the execution control will be inside the while loop until the
//drop down values gets populated
String[] options = selenium.getSelectOptions("name=num");
for (int i = 0; i < options.length; i++) {
if (options[i].equals("50 results")) {
selenium.select("name=num", options[i]);
break;
}
}
Thread.sleep(3000);
selenium.close();
selenium.stop();
server.stop();
}
}
1.ComboBox it self is an ajax element
2.The Combovalues gets dynamically populated on some event trigger
Point 1 can be handled using selenium.waitForCondition()
How about point 2 ? Below is the code
public class DynamicComboElementHandling {
static Selenium selenium;static SeleniumServer server;
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
selenium = new DefaultSelenium("localhost", 4444, "*firefox",
"http://www.google.com");
server = new SeleniumServer();
server.start();
selenium.start();
//Click on Google Advanced Search Link
selenium.open("/advanced_search?hl=en");
//Wait Until the Drop appears on the screen
selenium.waitForCondition("selenium.isElementPresent(\"name=num\");",
"15000");
boolean flag = true;
while (flag) {
//Get the count of the drop down values
int optionCount = selenium.getSelectOptions("name=num").length;
// if the dropdown is populated with values, come out of the while
// loop
// else continue looping until the count is > 0
if (optionCount > 0) {
break;
}
continue;
}
//This code will be executed only if dropdown has some values
//else the execution control will be inside the while loop until the
//drop down values gets populated
String[] options = selenium.getSelectOptions("name=num");
for (int i = 0; i < options.length; i++) {
if (options[i].equals("50 results")) {
selenium.select("name=num", options[i]);
break;
}
}
Thread.sleep(3000);
selenium.close();
selenium.stop();
server.stop();
}
}
Subscribe to:
Comments (Atom)