Here we have a very good article.
http://inderpsingh.blogspot.in/2010/02/how-to-evaluate-automated-software-test.html#!
Wednesday, 9 October 2013
Tuesday, 8 October 2013
What is the Selenium 2.0 architecture
If you are looking for more details about Selenium
You can get details over here..
how to take screen shot whenever there is a failure in the framework or test cases in selenium script ?
Our aim is to take screen shot whenever test case fail.There are several way to take screen shots.
1) By putting try catch - exception code in your framework whenever control comes to catch exception then take a screen shot by screen shot take method.
2) By putting listners
import java.io.File;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.TestListenerAdapter;
public class Screenshot extends TestListenerAdapter {
@Override
public void onTestFailure(ITestResult result) {
File file = new File("");
Reporter.setCurrentTestResult(result);
System.out.println(file.getAbsolutePath());
Reporter.log(file.getAbsolutePath());
Reporter.log("screenshot saved at "+file.getAbsolutePath()+"\\reports\\"+result.getName()+".jpg");
Reporter.log("<a href='../"+result.getName()+".jpg' <img src='../"+result.getName()+".jpg' hight='100' width='100'/> </a>");
BaseClass.selenium.captureScreenshot(file.getAbsolutePath()+"\\reports\\"+result.getName()+".jpg");
Reporter.setCurrentTestResult(null);
}
@Override
public void onTestSkipped(ITestResult result) {
// will be called after test will be skipped
}
@Override
public void onTestSuccess(ITestResult result) {
// will be called after test will pass
}
}
3) By writing After Method
@AfterMethod(alwaysRun = true, description = "take screenshot")
public void afterMethod_takeScreenshot(ITestResult result, Method m) throws Exception {
if (!result.isSuccess()) {
TakesScreenshot screen = (TakesScreenshot) driver;
File fileScreen = screen.getScreenshotAs(OutputType.FILE);
File fileTarget = new File("failure_" + m.getName() + ".png");
FileUtils.forceMkdir(fileTarget.getParentFile());
FileUtils.copyFile(fileScreen, fileTarget);
}
}
4)TestWatcher rule
http://junit-team.github.io/junit/javadoc/4.10/org/junit/rules/TestWatcher.html#!
1) By putting try catch - exception code in your framework whenever control comes to catch exception then take a screen shot by screen shot take method.
2) By putting listners
import java.io.File;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.TestListenerAdapter;
public class Screenshot extends TestListenerAdapter {
@Override
public void onTestFailure(ITestResult result) {
File file = new File("");
Reporter.setCurrentTestResult(result);
System.out.println(file.getAbsolutePath());
Reporter.log(file.getAbsolutePath());
Reporter.log("screenshot saved at "+file.getAbsolutePath()+"\\reports\\"+result.getName()+".jpg");
Reporter.log("<a href='../"+result.getName()+".jpg' <img src='../"+result.getName()+".jpg' hight='100' width='100'/> </a>");
BaseClass.selenium.captureScreenshot(file.getAbsolutePath()+"\\reports\\"+result.getName()+".jpg");
Reporter.setCurrentTestResult(null);
}
@Override
public void onTestSkipped(ITestResult result) {
// will be called after test will be skipped
}
@Override
public void onTestSuccess(ITestResult result) {
// will be called after test will pass
}
}
3) By writing After Method
@AfterMethod(alwaysRun = true, description = "take screenshot")
public void afterMethod_takeScreenshot(ITestResult result, Method m) throws Exception {
if (!result.isSuccess()) {
TakesScreenshot screen = (TakesScreenshot) driver;
File fileScreen = screen.getScreenshotAs(OutputType.FILE);
File fileTarget = new File("failure_" + m.getName() + ".png");
FileUtils.forceMkdir(fileTarget.getParentFile());
FileUtils.copyFile(fileScreen, fileTarget);
}
}
4)TestWatcher rule
http://junit-team.github.io/junit/javadoc/4.10/org/junit/rules/TestWatcher.html#!
What tools can I use to test Web services and APIs? what is the best tool for API testing
There are number of tools available in the market.
We can do web service testing by using either
Soap Ui,
Jmeter
or by using programming we can write either in JAVA, Python, Ruby.
If you would like to go by programming.I would say that also depends on your development team what programming language web services are written. You might want to use the same programming language in order to have developers support.
For API testing you don't need to deal with browser related and UI/ elements related hassle.
Testing WebServices is much easier than testing GUI. In nut-shall, you need to understand how HTTP requests are made & how responses can be consumed? Requests and responses are usually in the form of JSON or XML so you need to know relevant libraries (depending on the language you are using).
JMeter is also a good choice given that it's open source/free, it's relatively easy to use, and because it gives you rudimentary performance data with your test runs (average, min, max, median response times for all requests).
If you're open to a programming approach to testing, There is a tool called REST Assured over JMeter or similar tool. http://code.google.com/p/rest-assured/ A combination of TestNG and RESTAssured makes things pretty simple.
http://www.testinggeek.com/testing-restful-webservices-or-api-testing-remember-papas-be-sfo-deed-help-gc-and-dvla-pc#!
We can do web service testing by using either
Soap Ui,
Jmeter
or by using programming we can write either in JAVA, Python, Ruby.
If you would like to go by programming.I would say that also depends on your development team what programming language web services are written. You might want to use the same programming language in order to have developers support.
For API testing you don't need to deal with browser related and UI/ elements related hassle.
Testing WebServices is much easier than testing GUI. In nut-shall, you need to understand how HTTP requests are made & how responses can be consumed? Requests and responses are usually in the form of JSON or XML so you need to know relevant libraries (depending on the language you are using).
JMeter is also a good choice given that it's open source/free, it's relatively easy to use, and because it gives you rudimentary performance data with your test runs (average, min, max, median response times for all requests).
If you're open to a programming approach to testing, There is a tool called REST Assured over JMeter or similar tool. http://code.google.com/p/rest-assured/ A combination of TestNG and RESTAssured makes things pretty simple.
http://www.testinggeek.com/testing-restful-webservices-or-api-testing-remember-papas-be-sfo-deed-help-gc-and-dvla-pc#!
How to setup proxy settings for Chrome browser in selenium java
We can set up proxy settings for chrome as below.
Here I have stored proxy url, user name, password in config.properties file and calling to here.. other wise you can give details directly over here as well.
//Proxy settings
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setProxyType(ProxyType.MANUAL);
proxy.setHttpProxy(CONFIG.getProperty("hostname"));
proxy.setSslProxy(CONFIG.getProperty("hostname"));
proxy.setFtpProxy(CONFIG.getProperty("hostname"));
proxy.setSocksUsername(CONFIG.getProperty("username"));
proxy.setSocksPassword(CONFIG.getProperty("password"));
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
//DesiredCapabilities capabilities = DesiredCapabilities.chrome();
//capabilities.setCapability("chrome.switches", Arrays.asList("--proxy-server=http://user name:password@proxyurl:8080"));
// WebDriver driver = new ChromeDriver(capabilities);
driver = new ChromeDriver(cap);
builder = new Actions(driver);
bckdbrowser = new WebDriverBackedSelenium(driver,
ConfigReader.ENVIRONMENT_URL);
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS );
Friday, 27 September 2013
What is best automation tool for Mobile and ipad or Tablet testing
Here we have good tool.. I will keep on update other links as well.
http://www.perfectomobile.com/Solutions/DevOps
Here we have very good PPT about CALABASH tool which help us to test the mobile, Ipad / Tablet testing..
http://www.slideshare.net/DominikDary/calabashdriver
http://sauceio.com/index.php/2013/04/mobile-test-automation-in-java-with-appium/
Videos
http://www.youtube.com/watch?v=NioJ9fEZrMk#t=518
http://www.youtube.com/watch?v=1J0aXDbjiUE
http://www.youtube.com/watch?v=0an8l1RAe0M
Subscribe to:
Posts (Atom)