Some of the properties of Uiatomation

Source: Internet
Author: User
Tags home screen

This method automatically calls//Note: This method must be placed in front (that is, the specified click "Exit" to pop up this warning box, because it is loaded first) Uiatarget.onalert = function Onalert (alert) {    var title = Alert.name ();        Uialogger.logwarning ("Alert with title" + title);    Target.delay (5);        Uialogger.logmessage ("message");        if (title = = "is sure to exit?") {        Target.delay (5);        Alert.buttons () ["OK"].tap ();        return true;       }    return false;} var target = Uiatarget.localtarget ();//target.logelementtree (); var messages = "Test Alert"; Uialogger.logstart (messages);  Target.frontmostapp (). MainWindow (). Tableviews () [0].buttons () ["Sign Out"].tap (); Uialogger.logmessage ("message"); Target.delay (5); Uialogger.logpass (messages);  Summary: In the most important thing is to remember that the corresponding function of the alert before the code into the Saint alert, once the method to generate code, Uiatomation automated testing will call this method.


Here are some of the related properties that are understood:

1. Understanding of Element

Uiaelement (point) hitpoint ()//returns the position of the current click (rect) rect ()//The position of the returned control on the home screen (Uiaelementarray) activityindicators ()// Returns an array of active indicators (elements) (Uiaactivityview) ActivityView ()//Returns the object representing the active view (Uiaelementarray) ancestry ()//returns the ancestor (element array) of the specified object array gesture action (undefined) tap ()//target (undefined) doubletap ()//double-click (undefined) tapwithoptions (Object options)//Specify a specific gesture action on the specified control element/ /This dictionary is the characteristic of the specified gesture, the valid key of the feature has the following 4 types: Tapcount: The number of clicks (Default is 1) Touchcount: Number of lifting (this is usually referred to as the finger, the default is one) Duration: Duration of time, tap default 0, The gesture that is lifted and held (eg: drag, long press, etc. by default is 1) Tapoffset: Specifies the tap gesture, which is {x:0.0, y:0.0} by default. Make the click More accurate through the tapoffset of the polygon, the upper left corner is: {x:0.0,0.0} lower  right corner: {x : 1.0,1.0}, through this we understand the corresponding content. (This method will be used more, especially in the use of the reader, divided into different areas, will show different effects) (undefined) Twofingertap ()//two finger click (undefined) touchandhold (number Duration)//Touch and save the specified time (i.e. time delay for long Press) (decision) based on the state of the Factor (Boolean) IsValid ()//Determine whether the specified element is valid (Boolean) Checkisvalid ()// Also returns the state of the specified element (relative to the above element to determine that the control already exists)

Some property methods for Uiatarget:

How to manage your app (uiaapplication) Frontmostapp ()//Returns an object that represents your app//discussion: This Application object sets the control point and coordination points for your app//This Uiaapplication object is The centralized point of control and coordination for your app. Gets the basic target (object) and host object (Uiatarget) Localtarget ()//Returns an object that represents the test system ( Uiahost) host ()//Returns an object that represents the host of the current target. System-level operations (device property information): (string) model ()//device model (string) name ()//device name (rect) Rect ()//Return device Rectangle Range (String) SystemName ()/Return system name (String) Systemversion ()//returns the direction of the system's version device (number Deviceorientation) deviceorientation ()//direction of the current device returned (undefined) Setdeviceorientation (number Deviceorientation)//device current device Direction setting timeout: (number) Poptimeout ()//Eject timeout (undefined) pushtimeout (timeoutvalue)//Press-in timeout (undefined) setTimeout (number Timeout)//Set time-out (#) timeout ()//Get timeout value (Boolean) delay (# t Imeinterval)//Set delay (most commonly used) (Boolean) Onalert (uiaalert alert)//is called by UI Automation interface, allowing your script to alert alert// An instance that represents a warning can see that these constants have changed the prefix uia_device_orientation_unknown//direction do not know uia_device_orientation_portrait//equipment room longitudinal upright, The home key is on the bottom uia_device_orientation_portrait_upsidedown//device vertical inverted, the home button on the top Uia_device_orientation_landscapeleft//Horizontal, and the home key is on the right uia_device_orientation_landscaperight//landscape, and the home key is on the left Uia_device_ orientation_faceup//squared, screen up uia_device_orientation_facedown//flat, screen down flat, screen down (undefined) capturerectwithname ( Rect rect, string imageName)//Specifies the size of the screenshot (undefined) capturescreenwithname (String imageName)//Truncate full screen There are other appropriate methods to use to understand, such as: interaction and so on.


By the way, learn some techniques:

ATA Technology is a family of technical specifications for the IDE (Integrated Device Electronics). Initially, the IDE was just a hard-disk interface technology that attempted to integrate the controller with the disk body. With the increasingly extensive application of ide/eide, the global Standardization protocol induces the technical specifications used by the interface since its inception as a global hard drive standard, resulting in ATA (Advanced technology Attachment).

Serial scsi (sas:serial attached SCSI) is a kind of computer technology, which is mainly used as the interface for data transmission of peripheral parts, such as hard disk, CD-ROM and other devices. Serial SCSI evolved from the parallel SCSI physical storage interface and is a new storage interface standard developed and maintained by the ANSI INCITS T10 Technical Committee (T10 Committee). Sequential mode provides faster communication speeds and simpler configurations than parallel methods. In addition, SAS supports compatibility with Serial ATA (SATA) devices, and both can use similar cables.
The SAS interface uses a thinner cable with smaller connectors, saving space on the server or storage, and improving the cooling and ventilation capabilities of SAS hard disk servers. The traditional SCSI interface uses a larger parallel cable, which can cause some electronic interference, and this problem does not occur with the cable structure of the SAS. In addition, each SAS cable has four cables and two inputs with two outputs. SAS can read and write data at the same time, full-duplex data operation to improve data throughput efficiency.
In general, SAS technology is a combination of the advantages of SATA and SCSI, and serial scsi (SAS) is a point-to structure, so in addition to improving performance, each device connected to the specified data path to increase the bandwidth, thus providing the necessary protection for data transmission and access.






Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

An understanding of some of the properties of Uiatomation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.