4. 4CreamTec
TEST UI IN A REAL BROWSER
• Execute JavaScript and see ALL errors
• Load all resources (images, CSS)
• Test layouts and CSS properties
• Check colors and fonts
• Verify quirks of each browser type and version
• Is the ONLY way to be sure UI looks and works right
5. 5CreamTec
UI TESTING TOOLS
Frameworks
• Selenium browser automation
through WebDriver API
• QUnit unit testing JavaScript
inside and outside the browser
• CasperJS unit testing JavaScript
inside a headless browser
• GWTTestCase uses invisible
browser to run Java tests
Test Case Example
public class Example {
public static void main(String[] args) {
// Create a new instance of the html unit driver
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit Google
driver.get("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
element.submit();
// Verify result
assertTrue(selenium.isTextPresent(“Welcome"));
}
}
6. 6CreamTec
UI TESTING TOOLS
Products
• QuickTestPro feature rich IDE for
functional and regression testing
• Rational Test Workbench
functional, load and regression
testing from IBM
• SilkTest suite of testing products
targeting simplicity
Test Case Example
SystemUtil.Run "IEXPLORE.EXE","www. perfumes.com"
Wait 5
Set myBrowser=Browser("Perfumes-Discount perfume")
If myBrowser.Page("Perfumes-Discount
perfume").Link("Login").Exist(3) Then
Reporter.ReportEvent 0,"Res","Login Link Exists"
Else
Reporter.ReportEvent 1,"Res","Login Link Not Exists"
End If
9. 9CreamTec
UI AUTOMATION CHALLENGES
• Requires development skills (HTML/CSS/JavaScript/XPath)
• Requires knowledge of UI internals (id, structure, validation)
• Test creation takes too long
• Tests duplicate app logic
• Tests get out of sync and maintenance is tedious
• Takes too long to deal with UI changes
• Tests development delays releases
• Tools are not productive and too complex
10. 10CreamTec
VISUAL TESTING
• 10x productivity gain compared to traditional testing
• Automation of how you already test instead of learning how to use a tool
• Empower non-technical people to build and maintain tests
• Full access to Selenium API when needed
• Web based shared environment
18. 18CreamTec
CONCLUSIONS
• Don’t fall into manual testing trap
• Test business logic with API and unit
tests in native language (JUnit etc)
• Test complex JavaScript logic with
JavaScript unit tests (QUnit/CasperJS)
• Cover production UI with visual tests
(Screenster)
Notes de l'éditeur
Sourcing Line Computer Economics http://www.statisticbrain.com/outsourcing-statistics-by-country/Deloitte’s 2012 Global Outsourcing and Insourcing Survey http://deloitte.wsj.com/cfo/2012/09/18/outsourcing-becoming-standard-business-strategy-for-many-companies/
Gartner's 30 Leading Locations for Offshore Services - http://www.prominente.com.ar/pdfs/centrodesarrollo/Gartners%2030%20Leading%20Locations%20for%20Offshore%20Services..pdf pages#2-3
Wall Street Journal - http://online.wsj.com/article/SB10001424052748703515504576142092863219826.html?mod=WSJ_hp_MIDDLENexttoWhatsNewsTopHow many software developers are there in thecountry?How this number was calculated?1. Go to http://www.linkedin.com2. Go to Advanced Search3. Choose "Computer Software" and "Outsourcing and Offshoring" industries.4. Choose country.OR simple click the link belowUS - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=us&f_N=F,S,A,O&f_I=4,123&rsid=377867831375183296073&orig=MDYSBrazil - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=br&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181162945&orig=MDYSMexico - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=mx&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181173481&orig=MDYSArgentina - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ar&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181198734&orig=MDYSColombia - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ar&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181198734&orig=MDYSChina - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=cn&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181234137&orig=MDYSPhilippines - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ph&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181269403&orig=MDYSIndia - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=in&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181253044&orig=MDYSMalaysia http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=my&f_N=F,S,A,O&f_I=123,4&rsid=377867831375181283637&orig=MDYSPoland - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=my&f_N=F,S,A,O&f_I=123,4&rsid=377867831375181283637&orig=MDYSHungary - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=hu&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181325984&orig=MDYSRussia - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ru&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181337742&orig=MDYSUkraine - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ua&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181355594&orig=MDYSRomania - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=ro&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181367869&orig=MDYSCzech Republic - http://www.linkedin.com/vsearch/p?openAdvancedForm=true&locationType=I&countryCode=cz&f_N=F,S,A,O&f_I=4,123&rsid=377867831375181381476&orig=MDYS