Software Testing - SPLessons

Software Testing GUI Objects

Home > Lesson > Chapter 21
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Software Testing GUI Objects

GUI Objects

shape Description

Software Testing Web Drivers are mostly utilized devices among every one of the apparatuses accessible in the testing instrument set. In this way it is imperative to see how to utilize the features and how to communicate with web applications. Following are the GUI objects in software testing.

Keyboard Action

shape Description

There are three methods to perform key board actions Release key, Send key, Press Key.

Release Key

Release the discouraged left mouse catch at the present mouse area.

Send Key

Sends a progression of keystrokes onto the component Parameters: On Element - Component that will get the keystrokes, for the most part a content field. Charsequence - Any string esteem speaking to the grouping of keystrokes to be sent.

Press Key

Pressing a key on the keyboard that is NOT content. The keys, for example, function keys "F1", "F2", "Tab", "Control", and so on. On the off chance that key to Press is a grouping of characters, distinctive driver executions might chance a special case or to read just the main character in the succession.

Mouse Action

shape Description

Recorded underneath are a percentage of the key mouse activities that one would go over in the majority of the applications.

Mouse Down

Performs a mouse-down activity on a component or taking into account arranges.

Mouse Up

Releases the mouse as a rule took after by mouse-down and acts taking into account co-ordinates.

Mouse Move

Performs a mouse-move activity on a component or in view of directions.

contextClick

Performs a setting click on a component or taking into account the coordinatese.

Click

Performs a Click and likewise perform a tick in view of directions.

DoubleClick

Performs a double tap on the web element or taking into account the directions. On the off chance that left vacant, it performs double tap on the present area.

Text Box Interaction

shape Description

Text Box Interaction will tell how to collaborate with content boxes. It can place values into a content box utilizing the "sendkeys" technique. Essentially, likewise it recover content from a content box utilizing the getattribute("value") command. Percent calculator has taken as example.

shape Step 1

Drive to the below URL. Insert value in the Percentage Tab

shape Step 2

Open the above link with firebug and input code can be seen below.

shape Step 3

Insert the code for the above example. [java] import java.util.concurrent.TimeUnit; import org.openqa.concurrebt.*; import org.openqa.firefox.FirefoxDriver; ; public class webdriverdemo { public static void main(String[] args) throws InterruptedException { ; WebDriver driver = new FirefoxDriver(); // Give a Implicit wait, it will wait for 5 seconds before throwing exception driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); ; // Install website driver.navigate().to("http://www.calculator.net/percent-calculator.html"); ; // Maximize the browser driver.manage().window().maximize(); ; // Enter value 5 in the first number of the percent Calculator driver.findElement(By.id("cpar1")).sendKeys("5"); ; Thread.sleep(5000); ; // From the application get the text box String result = driver.findElement(By.id("cpar1")).getAttribute("value"); ; // Print a Log In message to the screen System.out.println(" The Result is " + result); ; // Close the program. driver.close(); } } [/java]

check box Interaction

shape Description

In this segment, it will see how to connect with Check Box. Choose a check box utilizing the "snap" strategy and uncheck utilizing the same "snap" technique.

Synchronization

shape Description

To synchronize between script execution and application, hold up to the wake of performing fitting activities. look at the approaches to accomplish the same.

Summary

shape Key Points

  • GUI Objects -Are the script permits clients to robotize GUI collaboration by utilizing screenshots.
  • GUI testing is a procedure used to test if the application is working effectively.