GUI Testing. 2 One of the practical methods commonly used to detect the presence of errors (failures) in a computer program is to exercise it by using.

Презентация:



Advertisements
Похожие презентации
Java Collections Framework (JCF) in Java Tutorial for students of universities Author: Oxana Dudnik.
Advertisements

WS8-1 WORKSHOP 8 DIRECT TRANSIENT RESPONSE WITH ENFORCED ACCELERATION MATRIX PARTITION APPROACH NAS122, Workshop 8, August 2005 Copyright 2005 MSC.Software.
WinCC Работа и мониторинг Siemens AG All rights reserved.© TC Nbg.-M Date: File: E02OFFe.PPT Catalog: NWINCC Открытость и способность.
2005 Pearson Education, Inc. All rights reserved. 1 Object-Oriented Programming: Polymorphism.
S5-1 PAT328, Section 5, September 2004 Copyright 2004 MSC.Software Corporation SECTION 5 RESULTS TITLE EDITOR.
WS17-1 WORKSHOP 17 DIRECT TRANSIENT ANALYSIS OF A CAR CHASSIS NAS122, Workshop 17, August 2005 Copyright 2005 MSC.Software Corporation.
1 When And How To Make Interfaces Work For You Advanced OO Techniques Alex Herbstritt Principal Software Engineer, Progress Software Session 102.
WS5-1 WORKSHOP 5 DIRECT FREQUENCY RESPONSE ANALYSIS NAS122, Workshop 5, August 2005 Copyright 2005 MSC.Software Corporation.
WS3-1 WORKSHOP 3 DIRECT TRANSIENT ANALYSIS NAS122, Workshop 3, August 2005 Copyright 2005 MSC.Software Corporation.
2005 Pearson Education, Inc. All rights reserved. 1 Object-Oriented Programming: Interface.
WS7-1 WORKSHOP 7 DIRECT TRANSIENT RESPONSE WITH ENFORCED ACCELERATION LARGE MASS METHOD NAS122, Workshop 7, August 2005 Copyright 2005 MSC.Software Corporation.
WS10b-1 WORKSHOP 10B FREQUENCY RESPONSE ANALYSIS OF A CIRCUIT BOARD NAS122, Workshop 10b, August 2005 Copyright 2005 MSC.Software Corporation.
© Luxoft Training 2013 Annotations. © Luxoft Training 2013 Java reflection / RTTI // given the name of a class, get a "Class" object that // has all info.
S15-1 PAT325, Section 15, February 2004 Copyright 2004 MSC.Software Corporation SECTION 15 OPTIMIZATION OF COMPOSITES USING MSC.NASTRAN.
1/30 Chapter 8: Dynamic Binding And Abstract classes.
1 © Luxoft Training 2012 Inner and anonymous classes.
Lecture # Computer Architecture Computer Architecture = ISA + MO ISA stands for instruction set architecture is a logical view of computer system.
Unit II Constructor Cont… Destructor Default constructor.
WS11-1 WORKSHOP 11 RANDOM VIBRATION ANALYSIS OF A SATELLITE MODEL USING MSC.RANDOM NAS122, Workshop 11, August 2005 Copyright 2005 MSC.Software Corporation.
WS4-1 WORKSHOP 4 MODAL TRANSIENT ANALYSIS NAS122, Workshop 4, August 2005 Copyright 2005 MSC.Software Corporation.
Транксрипт:

GUI Testing

2 One of the practical methods commonly used to detect the presence of errors (failures) in a computer program is to exercise it by using its Graphical User Interface. Our program The output is correct? I1, I2, I3, …, In, … Expected results = ? Obtained results Inputs GUI

3 GUI Testing A GUI (Graphical User Interface) is a hierarchical, graphical front end to a software system A GUI contains graphical objects, called widgets, each with a set of properties p, which have discrete values v at run-time. At any time during the execution, the values of the properties of each widget of a GUI define the GUI state:

4 GUI-based Testing Testing GUI software systems is different from testing non-GUI software Non-GUI testing: suites are composed of test cases that invoke methods of the system and catch the return value/s; GUI-based testing: suites are composed of test cases that are: able to recognize/identify the components of a GUI; able to exercise GUI events (e.g., mouse clicks); able to provide inputs to the GUI components (e.g., filling text fields); able to test the functionality underlying a GUI set of components; able to check the GUI representations to see if they are consistent with the expected ones; often, strongly dependent on the used technology;

Example: GUI testing

6 public class calcTest { Calc obj = new public void Testtt() { JButton oneJbu = (JButton)TestUtil.GetChildComp(obj, "oneButton"); assertNotNull(oneJbu); JTextField text = (JTextField)TestUtil.GetChildComp(obj, "TextField"); assertNotNull(text); oneJbu.doClick(); assertEquals("1", text.getText()); System.out.println(text.getText()); JButton addJbu = (JButton)TestUtil.GetChildComp(obj, "addButton"); addJbu.doClick();

JButton twoJbu = (JButton)TestUtil.GetChildComp(obj, "twoButton"); assertNotNull(twoJbu); twoJbu.doClick(); assertEquals("2", text.getText()); System.out.println(text.getText()); JButton equalJbu = (JButton)TestUtil.GetChildComp(obj, "jButton14"); equalJbu.doClick(); assertEquals("3", text.getText()); System.out.println(text.getText()); }

public class TestUtil{ public static Component GetChildComp(Component parent, String name){ if (name.equals(parent.getName())) return parent; if(parent instanceof Container) { Component[] children = ((Container)parent).getComponents(); for (int i = 0; i < children.length; i++) { Component child = GetChildComp(children[i], name); if(child != null) return child; } return null; } }

Testlash natijasi

public static Component getChildComp(Component parent, String name) { if (parent instanceof Container) { Component[] children = (parent instanceof JMenu) ? ((JMenu)parent).getMenuComponents() : ((Container)parent).getComponents();