-
Notifications
You must be signed in to change notification settings - Fork 32
/
WebElement.cfc
85 lines (66 loc) · 2.38 KB
/
WebElement.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
component hint="Represents an element in a page" output="false" {
public WebElement function init() {
// default to "we haven't found this web element"
variables._foundWebElement = false;
return this;
}
public any function getWebElement() {
return variables.webElement;
}
public void function setWebElement( required any webElement ) {
variables.webElement = arguments.webElement;
}
//TODO: Accept int as 2nd param, which indicates mouse and keyboard events - KEYPRESS.KEYDOWN ...
public void function sendKeys( required any keys ) {
local.localKeys = [];
arrayAppend( localKeys, toString( arguments.keys ) );
variables.webElement.sendKeys( local.localKeys );
}
public void function setFoundWebElement( required boolean value ) {
variables._foundWebElement = arguments.value;
}
public boolean function foundWebElement() {
return variables._foundWebElement;
}
public void function submit() {
variables.webElement.submit();
}
public string function getText() {
return variables.webElement.getText();
}
public void function clear() {
variables.webElement.clear();
}
public void function click() {
variables.webElement.click();
}
public boolean function isEnabled() {
return variables.webElement.isEnabled();
}
public boolean function isSelected() {
return variables.webElement.isSelected();
}
public string function getTagName() {
return variables.webElement.getTagName();
}
public string function getAttribute( required string attribute ) {
return variables.webElement.getAttribute( arguments.attribute );
}
// helper function for getting value
public string function getValue() {
return getAttribute( "value" );
}
//TODO ---------------------------------------
function dragAndDropBy(x,y){} //}(int, int) void
function dragAndDropOn(renderedElement){} //}(org.openqa.selenium.RenderedWebElement) void
function findElement(by){} //}(org.openqa.selenium.By) org.openqa.selenium.WebElement
function findElements(by){} //}(org.openqa.selenium.By) java.util.List
function getChildrenOfType(strElement){} //}(java.lang.String) java.util.List
function getLocation() {} //}ava.awt.Point
function getSize() {} //}java.awt.Dimension
function getValueOfCssProperty(css){} //}(java.lang.String) java.lang.String
function isDisplayed() {} //}boolean
// DEPRECATED --------------------------------
// toggle
// setSelected
}