© University of Liverpool

Slides:



Advertisements
Similar presentations
Welcome to the Award Winning Easiest to Use & Most Advanced View, Manage, and Control Security, Access Control, Video, Energy & Lighting Systems, & Critical.
Advertisements

©2009 Justin C. Klein Keane PHP Code Auditing Session 3 – Tools of the Trade & Crafting Malicious Input Justin C. Klein Keane
Ian Bablewski Calvin Flegal Katie McNabb Bryant Moquist Design Presentation.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
OM. Brad Gall Senior Consultant
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript & jQuery the missing manual Chapter 11
Samuvel Johnson nd MCA B. Contents  Introduction to Real-time systems  Two main types of system  Testing real-time software  Difficulties.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
Lecture 7 Interaction. Topics Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation.
Designing For Testability. Incorporate design features that facilitate testing Include features to: –Support test automation at all levels (unit, integration,
 Most current version 1.3  Will review some basic and advanced portions of the software  Only have 50 minutes including questions  Please write down.
IFORM ACCOUNT MAINTENANCE ICT4D SESSION 4. IFORMBUILDER WEBSITE REQUIREMENTS To access the iFormBuilder website, you need the following items: -Reliable.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
Web Automation Testing With Selenium By Rajesh Kanade.
Intro to Datazen.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Tata Consultancy Services1 WebDriver Basics Submitted By : Akhil K Gagan Deep Singh Naveenrajha H M Poornachandra Meduri Shubham Utsav Sunil Kumar G Vivek.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Part A. Remote Viewing IP Surveillance Camera Application Guide.
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
Installing and Configuring Moodle. Download Download latest Windows Install package from Moodle.orgMoodle.org.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
SoftUpdate New features and management technique.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
WEB TESTING
Fundamental of Databases
Test Web applications using Selenium
ASP.NET Programming with C# and SQL Server First Edition
© University of Liverpool
Integrating ArcSight with Enterprise Ticketing Systems
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Integrating ArcSight with Enterprise Ticketing Systems
Running a Forms Developer Application
Selenium and Selenium on Rails
Selenium HP Web Test Tool Training
Working in the Forms Developer Environment
Pilot Watcher Product Overview V5.3
System Architecture & Hardware Configurations
Selenium HP Web Test Tool Training
Lesson 4: Web Browsing.
Data Virtualization Tutorial… CORS and CIS
Designing For Testability
System Architecture & Hardware Configurations
Software Testing With Testopia
Software Quality Assurance
PHP Training at GoLogica in Bangalore
Multitier Architecture, MySQL & PHP
TROUBLESHOOT THE STREAMING PROBLEM OF HULU PLUS ON ANY DIGITAL MEDIA Smart Tv Help Line Toll Free ( )
Microsoft FrontPage 2003 Illustrated Complete
Database Driven Websites
PubMed Database Interface (Basic Course Module 4 Part A)
Employee Self Service An Introduction to Premier ESS.
Lecture 2 - SQL Injection
TaxSlayer Multi-Factor Authentication (MFA)
Lesson 4: Web Browsing.
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Lecture 34: Testing II April 24, 2017 Selenium testing script 7/7/2019
Tutorial Introduction to help.ebsco.com.
Web Application Development Using PHP
Selenium IDE Installation and Use.
Presentation transcript:

© University of Liverpool TESTING TOOLS COMP220/285 © University of Liverpool

© University of Liverpool Objectives At the end of this lecture, you should be able to Describe some common software tools Describe how different parts of a multi-tier application are tested Describe how databases can be tested/monitored COMP220/185 © University of Liverpool

© University of Liverpool Web Page testing API will send Requests to load up web pages Clicks of buttons (submit) and links Setting of test fields in web forms API will parse response to determine Title of page Error status Validity of fields on page COMP220/185 © University of Liverpool

© University of Liverpool JWebUnit Provides web site testing API Features Programmatic testing control Location, click, page parsing Javascript execution Limitations Only some core javascript is executed and understood Slower than browser, Javascript, v.slow COMP220/185 © University of Liverpool

© University of Liverpool JWebunit Example HtmlUnitTestingEngineImpl webunit=new HtmlUnitTestingEngineImpl(); webunit.setScriptingEnabled(false); try { webunit.beginAt(new URL("http://seb.fruitserver.com/mobile/lobby/Default.aspx"),new TestContext()); } catch (Exception exc) { exc.printStackTrace(); System.exit(1); } webunit.clickLinkWithExactText("Sign In",0); System.out.println("Page title is "+webunit.getCurrentPageTitle()); webunit.setTextField("tbEmail", "testsc01"); webunit.setTextField("tbPIN", "1608"); webunit.submit(); COMP220/185 © University of Liverpool

Remote controlled browser testing Loads up the browser Requests browser to open page Populates forms on page with data Goes to next page Example Selenium IDE plug for Firefox (record, playback, web actions) Remote control API (Firefox, Chrome, iOS) COMP220/185 © University of Liverpool

© University of Liverpool Why remote control Software doesn’t run in simulated but real environment Javascript/css support is different in different browsers Performance changes across browsers Javascript interactions such as Ajax will work properly COMP220/185 © University of Liverpool

Selenium IDE (running with Firefox) Doesn’t work with latest Firefox (v<=54) So uninstall and get earlier version https://ftp.mozilla.org/pub/firefox/releases/54.0/ Disable Auto update COMP220/185 © University of Liverpool

Firefox disabling updates Remove the following service Mozilla maintenance service In windows use Add Remove programs Remove Mozilla maintenance service COMP220/185 © University of Liverpool

Installing Selenium IDE https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/ Click Add to Firefox Give permission to install and then re-start Firefox COMP220/185 © University of Liverpool

Selenium IDE with Chrome A lot easier no version issue https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd COMP220/185 © University of Liverpool

© University of Liverpool Selenium IDE COMP220/185 © University of Liverpool

© University of Liverpool Selenium IDE commands All commands have name, target, value open Opens a page Arguments target = URL target=http://gmail.com type Types text into text box target (identity of element) id= name= value Value to type in COMP220/185 © University of Liverpool

Example open gmail account Username =  comp220.test Password = liverpool2012 COMP220/185 © University of Liverpool

© University of Liverpool clickAndWait Clicks an element on the web page and then waits for it to load Target defined as id name COMP220/185 © University of Liverpool

© University of Liverpool Assertions Test if values are what is expected Adding an assertion using Selenium IDE Right click on element Look for VerifyTextPresent COMP220/185 © University of Liverpool

© University of Liverpool Test case format <tr> <td>open</td> <td>http://gmail.com</td> <td></td> </tr> <td>type</td> <td>id=Passwd</td> <td>liverpool2012</td> <td>id=Email</td> <td>comp220.test</td> <td>clickAndWait</td> <td>id=signIn</td> COMP220/185 © University of Liverpool

© University of Liverpool Selenium web driver Connects your program to browser to allow remote control Example code… driver = new ChromeDriver(); driver.get("http://gmail.com"); driver.findElement(By.id("Passwd")).clear(); driver.findElement(By.id("Passwd")).sendKeys("liverpool2012"); driver.findElement(By.id("Email")).clear(); driver.findElement(By.id("Email")).sendKeys("comp220.test"); driver.findElement(By.id("signIn")).click(); COMP220/185 © University of Liverpool

Exporting test cases to program COMP220/185 © University of Liverpool

© University of Liverpool Test case exported @Before public void setUp() throws Exception { System.setProperty("webdriver.chrome.driver", "C:\\comp285\\chromedriver.exe"); driver = new ChromeDriver(); baseUrl = "https://accounts.google.com/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testGmailTestWebdriver() throws Exception { driver.get("http://gmail.com"); driver.findElement(By.id("Passwd")).clear(); driver.findElement(By.id("Passwd")).sendKeys("liverpool2012"); driver.findElement(By.id("Email")).clear(); driver.findElement(By.id("Email")).sendKeys("comp220.test"); driver.findElement(By.id("signIn")).click(); COMP220/185 © University of Liverpool

© University of Liverpool Test case exported try { assertTrue(driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*comp220\\.test@gmail\\.com[\\s\\S]*$")); } catch (Error e) { verificationErrors.append(e.toString()); } driver.findElement(By.id("gbgs4dn")).click(); driver.findElement(By.id("gb_71")).click(); COMP220/185 © University of Liverpool

© University of Liverpool Test case exported @After public void tearDown() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } COMP220/185 © University of Liverpool

© University of Liverpool Performance testing Typical architecture Application Server php/,Net/Servlet Ruby Database B R O W S E Internet LAN COMP220/185 © University of Liverpool

© University of Liverpool Performance testing Assuming a 3-tier architecture, problems with performance could be In browser (e.g. javascript performance issue) In transmission network (e.g. size of download, images, jscript, HTML) Particularly true with mobile network Within LAN At Application server At Database server COMP220/185 © University of Liverpool

Testing Performance problems Browser side Function of content and browser So test needs to be done On browser But automatically Needs support for Remote control of browser See last topic COMP220/185 © University of Liverpool

Internet speed simulation Slow internet connections cause Connections to timeout Requests to fail User experience may suffer Issues Software may send multiple requests Loading screens need testing Code can measure link speed, then optimize With mobile applications slow network speed is common COMP220/185 © University of Liverpool

Internet Speed Simulation http://www.ngcoders.com/downloads/internet-speed-simulator-proxy-throttler/ Browser connects to speed simulator via proxy interface COMP220/185 © University of Liverpool

Configuring the proxy interface Firefox Tools/Options/Advanced/Network/Settings iPhone Settings/WiFi/Choose a Network COMP220/185 © University of Liverpool

Android proxy configuration Applications/Settings/Wi-Fi Tap and hold Wi-Fi connection, then Modify Network Check Show Advanced options Enter proxy via manual settings COMP220/185 © University of Liverpool

Server side performance testing Application server Performance related to request load and service time In general traffic measured in Erlangs Erlang = service time/request interval So A load of 200 requests per second = request interval = 5 ms If each request takes on average 3 ms to service Load = 3/5 = 0.6 Erlangs COMP220/185 © University of Liverpool

Application server/Database loading If the transaction only involves the middle tier Performance generally only current load Database transaction time depends on Database load State of database Size of tables Complexity of transaction (table joins etc.) Table locking or transactional operations COMP220/185 © University of Liverpool

© University of Liverpool Example SQL Balance query Select sum(amount) from account_transaction where userid=1234 and account=25 Login select * from users where login=“fred” Joins (orphan transaction search) select TransactionID from user as a right outer join account_transaction as b on a.CustomerID = b.CustomerID where a.CustomerID is null; COMP220/185 © University of Liverpool

© University of Liverpool Bench marking queries Important to benchmark queries with given sizes of table Looking up user/password in 10,000 users 250,000 users Find transaction balance for table with 100,000 or 250,000,000 transactions At what point will service suffer Need to insert alerts when tables grow to critical size COMP220/185 © University of Liverpool

© University of Liverpool mysqlslap Used to stress test your database Can run this On it own to get benchmark Concurrently with application Parameters --concurrency=500 --iterations=20000 --query --user, --password COMP220/185 © University of Liverpool

© University of Liverpool Database load testing Have test patterns which Do complex operations such as creating many new accounts Fill up tables with multiple transactions Do many different transactions at the same time Creating accounts Logging in Performing transactions COMP220/185 © University of Liverpool

© University of Liverpool Database monitoring COMP220/185 © University of Liverpool

Database monitoring and alerting Examine in real time state of database Heavy loading could be due to Normal increase in customer traffic DOS attack Problems with table scaling Alerts Certain load conditions Slow queries Too many SQL errors COMP220/185 © University of Liverpool

© University of Liverpool MySQL slow query log Can be configured to store queries which take over a certain time threshold e.g. >10 seconds Slow queries will Cause that user to suffer poor service Push other queries back up the queue If combined with table locking, cause other queries to lock out COMP220/185 © University of Liverpool

© University of Liverpool Summary Testing involves Strategy of what to test Need to test All parts of multi-tier application Under different conditions Database performance changes as it grows Need for monitoring Keep testing/monitoring live site COMP220/185 © University of Liverpool