PDFEdit Object
Description
An edit box in an interactive PDF document.
Operations
The sections below list the built-in methods and properties that you can use as operations for the PDFEdit object.
Note: You can also view a list and descriptions of the PDFEdit description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
CaptureBitmap | Saves a screen capture of the object as a .png or .bmp image using the specified file name. |
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
Click | Clicks the object. |
DblClick | Double-clicks the object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetROProperty | Returns the current value of the description property from the object in the application. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
Highlight | Highlights the object in the application. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs UFT One to re-identify the object in the application the next time a step refers to this object. |
Set | Sets the value of the edit box. |
SetCaretPos | Places the cursor at the specified position in the edit box. |
SetFocus | Activates the selected object and brings it into focus. |
SetSecure | Sets the encrypted value of the edit box. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
ToString | Returns a string that represents the test object. |
Type | Simulates keyboard input on the object. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
Exist | Checks whether the object currently exists in the open application. |
Click Method
Description
Clicks the object.
Syntax
object.Click [X], [Y], [MouseButton]
Arguments
Parameter | Description |
---|---|
X |
Optional. An integer value. The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
Y |
Optional. An integer value. The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object.
Default value = -9999 |
MouseButton |
Optional. A predefined constant or number. The mouse button to use for the click. Default value = micLeftBtn |
Return Type
None
Example
'The following example left-clicks in the center of the edit box 'and then right-clicks a specific point in the box. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").Click PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").Click 10, 3, Right_Mouse_Button
DblClick Method
Description
Double-clicks the object.
Syntax
object.DblClick X, Y, [MouseButton]
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The x-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. |
Y |
Required. An integer value. The y-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. |
MouseButton |
Optional. A predefined constant or number. The mouse button to use for the double-click. Default value = micLeftBtn |
Return Type
None
Example
'The following example double-left-clicks in the center of the edit box 'and then double-right-clicks a specific point in the box. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").DblClick PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").DblClick 10, 3, Right_Mouse_Button
Set Method
Description
Sets the value of the edit box.
Syntax
object.Set text
Arguments
Parameter | Description |
---|---|
text | Required. A string value. The text to enter in the edit box. |
Return Type
None.
Example
'The following example enters text in an edit box in a PDF application. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").Set "This is my comment."
SetCaretPos Method
Description
Places the cursor at the specified position in the edit box.
Syntax
object.SetCaretPos position
Arguments
Parameter | Description |
---|---|
position | Required. A string value. The position at which to place the cursor. |
Return Type
None.
Example
'The following example places the caret at position 6 in the edit box 'in a PDF application. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").SetCaretPos 7
SetFocus Method
Description
Activates the selected object and brings it into focus.
Syntax
object.SetFocus
Return Type
None.
Example
'The following example sets the focus on an edit box in an open PDF application. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").SetFocus
SetSecure Method
Description
Sets the encrypted value of the edit box.
Syntax
object.SetSecure text
Arguments
Parameter | Description |
---|---|
text | Required. A string value. The encrypted text to enter in the edit box. |
Return Type
None.
Example
'The following example enters an encrypted password in an edit box in a PDF application. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").SetSecure "45850fbdaec056421d43bd566351a25d8b9b3ccf"
Type Method
Description
Simulates keyboard input on the object.
Syntax
object.Type KeyboardInput
Arguments
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KeyboardInput |
Required. A String value.
|
Return Type
None
IMPORTANT
Although the Type method is supported for most objects, if you enter a Type statement for an object in which a user cannot enter text, the method has no visual effect.
Example
'The following example uses the Home key to start from the beginning 'of the edit box and then types in the PDF edit box. PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").Type micHome PDFApplication("Sample.pdf").PDFPage("Page 1").PDFEdit("PDFEdit").Type "A typed string"
See also: