robo_appian 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of robo_appian might be problematic. Click here for more details.
- robo_appian/components/ButtonUtils.py +24 -4
- robo_appian/components/DateUtils.py +22 -7
- robo_appian/components/DropdownUtils.py +59 -18
- robo_appian/components/InputUtils.py +23 -8
- robo_appian/components/LabelUtils.py +11 -2
- robo_appian/components/LinkUtils.py +11 -6
- robo_appian/components/SearchInputUtils.py +12 -5
- robo_appian/components/TabUtils.py +12 -2
- robo_appian/components/TableUtils.py +58 -10
- {robo_appian-0.0.7.dist-info → robo_appian-0.0.9.dist-info}/METADATA +1 -1
- robo_appian-0.0.9.dist-info/RECORD +21 -0
- robo_appian-0.0.7.dist-info/RECORD +0 -21
- {robo_appian-0.0.7.dist-info → robo_appian-0.0.9.dist-info}/LICENSE +0 -0
- {robo_appian-0.0.7.dist-info → robo_appian-0.0.9.dist-info}/WHEEL +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
|
|
6
6
|
class ButtonUtils:
|
|
7
7
|
"""
|
|
@@ -37,7 +37,16 @@ class ButtonUtils:
|
|
|
37
37
|
# This method locates a button that contains a span with the specified label text.
|
|
38
38
|
|
|
39
39
|
xpath = f".//button[./span[contains(translate(normalize-space(.), '\u00a0', ' '), '{label}')]]"
|
|
40
|
-
|
|
40
|
+
try:
|
|
41
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
42
|
+
except TimeoutError as e:
|
|
43
|
+
raise TimeoutError(
|
|
44
|
+
f"Button with label '{label}' not found or not clickable."
|
|
45
|
+
) from e
|
|
46
|
+
except Exception as e:
|
|
47
|
+
raise RuntimeError(
|
|
48
|
+
f"Button with label '{label}' not found or not clickable."
|
|
49
|
+
) from e
|
|
41
50
|
return component
|
|
42
51
|
|
|
43
52
|
@staticmethod
|
|
@@ -54,6 +63,7 @@ class ButtonUtils:
|
|
|
54
63
|
"""
|
|
55
64
|
component = ButtonUtils.find(wait, label)
|
|
56
65
|
component.click()
|
|
66
|
+
|
|
57
67
|
@staticmethod
|
|
58
68
|
def clickInputButtonById(wait: WebDriverWait, id: str):
|
|
59
69
|
"""
|
|
@@ -67,5 +77,15 @@ class ButtonUtils:
|
|
|
67
77
|
ButtonUtils.clickInputButtonById(wait, "button_id")
|
|
68
78
|
|
|
69
79
|
"""
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
try:
|
|
81
|
+
component = wait.until(EC.element_to_be_clickable((By.ID, id)))
|
|
82
|
+
except TimeoutError as e:
|
|
83
|
+
raise TimeoutError(
|
|
84
|
+
f"Input button with id '{id}' not found or not clickable."
|
|
85
|
+
) from e
|
|
86
|
+
except Exception as e:
|
|
87
|
+
raise RuntimeError(
|
|
88
|
+
f"Input button with id '{id}' not found or not clickable."
|
|
89
|
+
) from e
|
|
90
|
+
|
|
91
|
+
component.click()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
-
from selenium.webdriver.remote.webdriver import WebDriver
|
|
5
4
|
from selenium.webdriver.remote.webelement import WebElement
|
|
6
5
|
|
|
7
6
|
from robo_appian.components.InputUtils import InputUtils
|
|
@@ -37,11 +36,18 @@ class DateUtils:
|
|
|
37
36
|
"""
|
|
38
37
|
|
|
39
38
|
xpath = f".//div/label[text()='{label}']"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
try:
|
|
40
|
+
component: WebElement = wait.until(
|
|
41
|
+
EC.element_to_be_clickable((By.XPATH, xpath))
|
|
42
|
+
)
|
|
43
|
+
except TimeoutError as e:
|
|
44
|
+
raise TimeoutError(
|
|
45
|
+
f"Could not find clickable date component with label '{label}': {e}"
|
|
46
|
+
)
|
|
47
|
+
except Exception as e:
|
|
48
|
+
raise Exception(
|
|
49
|
+
f"Could not find clickable date component with label '{label}': {e}"
|
|
50
|
+
)
|
|
45
51
|
|
|
46
52
|
attribute: str = "for"
|
|
47
53
|
component_id = component.get_attribute(attribute) # type: ignore[reportUnknownMemberType]
|
|
@@ -50,7 +56,16 @@ class DateUtils:
|
|
|
50
56
|
f"Could not find component using {attribute} attribute for label '{label}'."
|
|
51
57
|
)
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
try:
|
|
60
|
+
component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
|
|
61
|
+
except TimeoutError as e:
|
|
62
|
+
raise TimeoutError(
|
|
63
|
+
f"Could not find clickable date input with id '{component_id}': {e}"
|
|
64
|
+
)
|
|
65
|
+
except Exception as e:
|
|
66
|
+
raise Exception(
|
|
67
|
+
f"Could not find clickable date input with id '{component_id}': {e}"
|
|
68
|
+
)
|
|
54
69
|
return component
|
|
55
70
|
|
|
56
71
|
@staticmethod
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import stat
|
|
2
|
-
from turtle import st
|
|
3
1
|
from selenium.webdriver.common.by import By
|
|
4
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
5
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
6
|
-
from selenium.webdriver.remote.webdriver import WebDriver
|
|
7
4
|
from selenium.webdriver.remote.webelement import WebElement
|
|
8
5
|
|
|
9
6
|
from robo_appian.components.InputUtils import InputUtils
|
|
@@ -26,10 +23,18 @@ class DropdownUtils:
|
|
|
26
23
|
|
|
27
24
|
@staticmethod
|
|
28
25
|
def __findDropdownComponentsByXpath(wait: WebDriverWait, xpath: str):
|
|
29
|
-
|
|
30
26
|
try:
|
|
31
27
|
# Wait for at least one element to be present
|
|
32
|
-
|
|
28
|
+
try:
|
|
29
|
+
wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
30
|
+
except TimeoutError as e:
|
|
31
|
+
raise TimeoutError(
|
|
32
|
+
f'No clickable dropdown component found for xpath "{xpath}": {str(e)}'
|
|
33
|
+
)
|
|
34
|
+
except Exception as e:
|
|
35
|
+
raise Exception(
|
|
36
|
+
f'No clickable dropdown component found for xpath "{xpath}": {str(e)}'
|
|
37
|
+
)
|
|
33
38
|
|
|
34
39
|
# Find all matching elements
|
|
35
40
|
driver = wait._driver
|
|
@@ -59,12 +64,23 @@ class DropdownUtils:
|
|
|
59
64
|
|
|
60
65
|
@staticmethod
|
|
61
66
|
def selectDropdownValueByComponent(wait, combobox, value):
|
|
62
|
-
dropdown_id = combobox.get_attribute("aria-controls")
|
|
67
|
+
dropdown_id = combobox.get_attribute("aria-controls")
|
|
63
68
|
combobox.click()
|
|
64
69
|
|
|
65
70
|
option_xpath = f'.//div/ul[@id="{dropdown_id}"]/li[./div[normalize-space(text())="{value}"]]'
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
try:
|
|
72
|
+
component = wait.until(
|
|
73
|
+
EC.presence_of_element_located((By.XPATH, option_xpath))
|
|
74
|
+
)
|
|
75
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, option_xpath)))
|
|
76
|
+
except TimeoutError as e:
|
|
77
|
+
raise TimeoutError(
|
|
78
|
+
f'Could not find or click dropdown option "{value}" with xpath "{option_xpath}": {str(e)}'
|
|
79
|
+
)
|
|
80
|
+
except Exception as e:
|
|
81
|
+
raise Exception(
|
|
82
|
+
f'Could not find or click dropdown option "{value}" with xpath "{option_xpath}": {str(e)}'
|
|
83
|
+
)
|
|
68
84
|
component.click()
|
|
69
85
|
|
|
70
86
|
@staticmethod
|
|
@@ -78,7 +94,6 @@ class DropdownUtils:
|
|
|
78
94
|
def selectDropdownValueByLabelText(
|
|
79
95
|
wait: WebDriverWait, dropdown_label: str, value: str
|
|
80
96
|
):
|
|
81
|
-
|
|
82
97
|
xpath = f'.//div[./div/span[normalize-space(text())="{dropdown_label}"]]/div/div/div/div[@role="combobox" and @tabindex="0"]'
|
|
83
98
|
DropdownUtils.__selectDropdownValueByXpath(wait, xpath, value)
|
|
84
99
|
|
|
@@ -86,13 +101,11 @@ class DropdownUtils:
|
|
|
86
101
|
def selectDropdownValueByPartialLabelText(
|
|
87
102
|
wait: WebDriverWait, dropdown_label: str, value: str
|
|
88
103
|
):
|
|
89
|
-
|
|
90
104
|
xpath = f'.//div[./div/span[contains(normalize-space(text()), "{dropdown_label}")]]/div/div/div/div[@role="combobox" and @tabindex="0"]'
|
|
91
105
|
DropdownUtils.__selectDropdownValueByXpath(wait, xpath, value)
|
|
92
106
|
|
|
93
107
|
@staticmethod
|
|
94
108
|
def __selectSearchDropdownValueByXpath(wait, xpath, value):
|
|
95
|
-
|
|
96
109
|
components = DropdownUtils.__findDropdownComponentsByXpath(wait, xpath)
|
|
97
110
|
|
|
98
111
|
for component in components:
|
|
@@ -102,13 +115,33 @@ class DropdownUtils:
|
|
|
102
115
|
component.click()
|
|
103
116
|
|
|
104
117
|
input_component_id = str(component_id) + "_searchInput"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
try:
|
|
119
|
+
input_component = wait.until(
|
|
120
|
+
EC.element_to_be_clickable((By.ID, input_component_id))
|
|
121
|
+
)
|
|
122
|
+
except TimeoutError as e:
|
|
123
|
+
raise TimeoutError(
|
|
124
|
+
f'Could not find or click search input component with id "{input_component_id}": {str(e)}'
|
|
125
|
+
)
|
|
126
|
+
except Exception as e:
|
|
127
|
+
raise Exception(
|
|
128
|
+
f'Could not find or click search input component with id "{input_component_id}": {str(e)}'
|
|
129
|
+
)
|
|
108
130
|
InputUtils._setComponentValue(input_component, value)
|
|
109
131
|
|
|
110
132
|
xpath = f'.//ul[@id="{dropdown_id}"]/li[./div[normalize-space(text())="{value}"]][1]'
|
|
111
|
-
|
|
133
|
+
try:
|
|
134
|
+
component = wait.until(
|
|
135
|
+
EC.element_to_be_clickable((By.XPATH, xpath))
|
|
136
|
+
)
|
|
137
|
+
except TimeoutError as e:
|
|
138
|
+
raise TimeoutError(
|
|
139
|
+
f'Could not find or click search dropdown option "{value}" with xpath "{xpath}": {str(e)}'
|
|
140
|
+
)
|
|
141
|
+
except Exception as e:
|
|
142
|
+
raise Exception(
|
|
143
|
+
f'Could not find or click search dropdown option "{value}" with xpath "{xpath}": {str(e)}'
|
|
144
|
+
)
|
|
112
145
|
component.click()
|
|
113
146
|
|
|
114
147
|
@staticmethod
|
|
@@ -122,7 +155,6 @@ class DropdownUtils:
|
|
|
122
155
|
def selectSearchDropdownValueByPartialLabelText(
|
|
123
156
|
wait: WebDriverWait, dropdown_label: str, value: str
|
|
124
157
|
):
|
|
125
|
-
|
|
126
158
|
xpath = f'.//div[./div/span[contains(normalize-space(text()), "{dropdown_label}")]]/div/div/div/div[@role="combobox" and @tabindex="0"]'
|
|
127
159
|
DropdownUtils.__selectSearchDropdownValueByXpath(wait, xpath, value)
|
|
128
160
|
|
|
@@ -130,7 +162,16 @@ class DropdownUtils:
|
|
|
130
162
|
def selectValueByDropdownWrapperComponent(
|
|
131
163
|
wait: WebDriverWait, component: WebElement, value: str
|
|
132
164
|
):
|
|
133
|
-
xpath =
|
|
134
|
-
|
|
165
|
+
xpath = './div/div[@role="combobox" and @tabindex="0"]'
|
|
166
|
+
try:
|
|
167
|
+
combobox = component.find_element(By.XPATH, xpath)
|
|
168
|
+
except TimeoutError as e:
|
|
169
|
+
raise TimeoutError(
|
|
170
|
+
f'Could not find combobox element with xpath "{xpath}" in the provided component: {str(e)}'
|
|
171
|
+
)
|
|
172
|
+
except Exception as e:
|
|
173
|
+
raise Exception(
|
|
174
|
+
f'Could not find combobox element with xpath "{xpath}" in the provided component: {str(e)}'
|
|
175
|
+
)
|
|
135
176
|
DropdownUtils.selectDropdownValueByComponent(wait, combobox, value)
|
|
136
177
|
return combobox
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import stat
|
|
2
|
-
from numpy import size
|
|
3
1
|
from robo_appian.utils.ComponentUtils import ComponentUtils
|
|
4
2
|
from selenium.webdriver.common.by import By
|
|
5
3
|
from selenium.webdriver.common.keys import Keys
|
|
6
4
|
from selenium.webdriver.support import expected_conditions as EC
|
|
7
5
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
8
6
|
from selenium.webdriver.remote.webelement import WebElement
|
|
9
|
-
from typing import List
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
class InputUtils:
|
|
@@ -56,10 +53,19 @@ class InputUtils:
|
|
|
56
53
|
attribute: str = "for"
|
|
57
54
|
component_id = label_component.get_attribute(attribute) # type: ignore[reportUnknownMemberType]
|
|
58
55
|
if component_id:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
try:
|
|
57
|
+
component = wait.until(
|
|
58
|
+
EC.element_to_be_clickable((By.ID, component_id))
|
|
59
|
+
)
|
|
60
|
+
input_components.append(component)
|
|
61
|
+
except TimeoutError as e:
|
|
62
|
+
raise TimeoutError(
|
|
63
|
+
f"Timeout or error finding input component with id '{component_id}': {e}"
|
|
64
|
+
)
|
|
65
|
+
except Exception as e:
|
|
66
|
+
raise Exception(
|
|
67
|
+
f"Timeout or error finding input component with id '{component_id}': {e}"
|
|
68
|
+
)
|
|
63
69
|
return input_components
|
|
64
70
|
|
|
65
71
|
@staticmethod
|
|
@@ -109,6 +115,15 @@ class InputUtils:
|
|
|
109
115
|
|
|
110
116
|
@staticmethod
|
|
111
117
|
def setValueById(wait: WebDriverWait, component_id: str, value: str):
|
|
112
|
-
|
|
118
|
+
try:
|
|
119
|
+
component = wait.until(EC.element_to_be_clickable((By.ID, component_id)))
|
|
120
|
+
except TimeoutError as e:
|
|
121
|
+
raise TimeoutError(
|
|
122
|
+
f"Timeout or error finding input component with id '{component_id}': {e}"
|
|
123
|
+
)
|
|
124
|
+
except Exception as e:
|
|
125
|
+
raise Exception(
|
|
126
|
+
f"Timeout or error finding input component with id '{component_id}': {e}"
|
|
127
|
+
)
|
|
113
128
|
InputUtils._setComponentValue(component, value)
|
|
114
129
|
return component
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
-
from selenium.webdriver.remote.webdriver import WebDriver
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class LabelUtils:
|
|
@@ -36,7 +35,17 @@ class LabelUtils:
|
|
|
36
35
|
# It uses XPath to find the element that matches the text.
|
|
37
36
|
|
|
38
37
|
xpath = f".//*[normalize-space(text())='{label}']"
|
|
39
|
-
|
|
38
|
+
try:
|
|
39
|
+
component = wait.until(EC.presence_of_element_located((By.XPATH, xpath)))
|
|
40
|
+
except TimeoutError as e:
|
|
41
|
+
raise TimeoutError(
|
|
42
|
+
f"Label '{label}' not found within the timeout period."
|
|
43
|
+
) from e
|
|
44
|
+
except Exception as e:
|
|
45
|
+
raise Exception(
|
|
46
|
+
f"Label '{label}' not found within the timeout period."
|
|
47
|
+
) from e
|
|
48
|
+
|
|
40
49
|
return component
|
|
41
50
|
|
|
42
51
|
@staticmethod
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
-
from selenium.webdriver.remote.webdriver import WebDriver
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class LinkUtils:
|
|
8
|
-
|
|
9
7
|
"""
|
|
10
8
|
Utility class for interacting with link components in Appian UI.
|
|
11
9
|
|
|
@@ -16,15 +14,22 @@ class LinkUtils:
|
|
|
16
14
|
LinkUtils.click(wait, "Learn More")
|
|
17
15
|
|
|
18
16
|
"""
|
|
17
|
+
|
|
19
18
|
@staticmethod
|
|
20
19
|
def find(wait: WebDriverWait, label: str):
|
|
21
20
|
xpath = f'.//a[normalize-space(text())="{label}"]'
|
|
22
|
-
|
|
21
|
+
try:
|
|
22
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
23
|
+
except TimeoutError as e:
|
|
24
|
+
raise TimeoutError(
|
|
25
|
+
f"Could not find clickable link with label '{label}': {e}"
|
|
26
|
+
)
|
|
27
|
+
except Exception as e:
|
|
28
|
+
raise Exception(f"Could not find clickable link with label '{label}': {e}")
|
|
23
29
|
return component
|
|
24
30
|
|
|
25
31
|
@staticmethod
|
|
26
32
|
def click(wait: WebDriverWait, label: str):
|
|
27
|
-
|
|
28
33
|
"""
|
|
29
34
|
Clicks a link identified by its label.
|
|
30
35
|
|
|
@@ -35,7 +40,7 @@ class LinkUtils:
|
|
|
35
40
|
Example:
|
|
36
41
|
LinkUtils.click(wait, "Learn More")
|
|
37
42
|
"""
|
|
38
|
-
|
|
39
|
-
component = LinkUtils.find(wait
|
|
43
|
+
|
|
44
|
+
component = LinkUtils.find(wait, label)
|
|
40
45
|
component.click()
|
|
41
46
|
return component
|
|
@@ -6,7 +6,6 @@ from robo_appian.utils.ComponentUtils import ComponentUtils
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class SearchInputUtils:
|
|
9
|
-
|
|
10
9
|
@staticmethod
|
|
11
10
|
def __findSearchInputComponentsByLabelPathAndSelectValue(
|
|
12
11
|
wait: WebDriverWait, xpath: str, value: str
|
|
@@ -19,9 +18,18 @@ class SearchInputUtils:
|
|
|
19
18
|
if dropdown_list_id:
|
|
20
19
|
InputUtils._setComponentValue(search_input_component, value)
|
|
21
20
|
xpath = f".//ul[@id='{dropdown_list_id}' and @role='listbox' ]/li[@role='option']/div/div/div/div/div/div/p[text()='{value}'][1]"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
try:
|
|
22
|
+
drop_down_item = wait.until(
|
|
23
|
+
EC.element_to_be_clickable((By.XPATH, xpath))
|
|
24
|
+
)
|
|
25
|
+
except TimeoutError as e:
|
|
26
|
+
raise TimeoutError(
|
|
27
|
+
f"Dropdown item with value '{value}' not found for component '{search_input_component.text}'."
|
|
28
|
+
) from e
|
|
29
|
+
except Exception as e:
|
|
30
|
+
raise RuntimeError(
|
|
31
|
+
f"Dropdown item with value '{value}' not found for component '{search_input_component.text}'."
|
|
32
|
+
) from e
|
|
25
33
|
drop_down_item.click()
|
|
26
34
|
else:
|
|
27
35
|
raise ValueError(
|
|
@@ -52,7 +60,6 @@ class SearchInputUtils:
|
|
|
52
60
|
|
|
53
61
|
@staticmethod
|
|
54
62
|
def selectSearchDropdownByLabelText(wait: WebDriverWait, label: str, value: str):
|
|
55
|
-
|
|
56
63
|
SearchInputUtils.__selectSearchInputComponentsByLabelText(wait, label, value)
|
|
57
64
|
|
|
58
65
|
@staticmethod
|
|
@@ -35,7 +35,12 @@ class TabUtils:
|
|
|
35
35
|
# This method locates a tab that is currently selected and contains the specified label.
|
|
36
36
|
|
|
37
37
|
xpath = f".//div[./div[./div/div/div/div/div/p/strong[normalize-space(text())='{label}']]/span[text()='Selected Tab.']]/div[@role='link']"
|
|
38
|
-
|
|
38
|
+
try:
|
|
39
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
40
|
+
except TimeoutError as e:
|
|
41
|
+
raise TimeoutError(f"Could not find selected tab with label '{label}': {e}")
|
|
42
|
+
except Exception as e:
|
|
43
|
+
raise RuntimeError(f"Could not find selected tab with label '{label}': {e}")
|
|
39
44
|
return component
|
|
40
45
|
|
|
41
46
|
@staticmethod
|
|
@@ -54,5 +59,10 @@ class TabUtils:
|
|
|
54
59
|
|
|
55
60
|
xpath = f".//div[@role='link']/div/div/div/div/div[./p/span[text()='{label}']]"
|
|
56
61
|
# xpath=f".//div[./div[./div/div/div/div/div/p/strong[normalize-space(text())='{label}']]/span[text()='Selected Tab.']]/div[@role='link']"
|
|
57
|
-
|
|
62
|
+
try:
|
|
63
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
64
|
+
except TimeoutError as e:
|
|
65
|
+
raise TimeoutError(f"Could not find tab with label '{label}': {e}")
|
|
66
|
+
except Exception as e:
|
|
67
|
+
raise RuntimeError(f"Could not find tab with label '{label}': {e}")
|
|
58
68
|
component.click()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from selenium.webdriver.common.by import By
|
|
2
2
|
from selenium.webdriver.support import expected_conditions as EC
|
|
3
3
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
-
from selenium.webdriver.remote.webdriver import WebDriver
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class TableUtils:
|
|
@@ -38,7 +37,16 @@ class TableUtils:
|
|
|
38
37
|
|
|
39
38
|
# xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]"
|
|
40
39
|
xpath = f'.//table[./thead/tr/th[@abbr="{columnName}"]]'
|
|
41
|
-
|
|
40
|
+
try:
|
|
41
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
42
|
+
except TimeoutError as e:
|
|
43
|
+
raise TimeoutError(
|
|
44
|
+
f"Could not find table with column name '{columnName}': {e}"
|
|
45
|
+
)
|
|
46
|
+
except Exception as e:
|
|
47
|
+
raise RuntimeError(
|
|
48
|
+
f"Could not find table with column name '{columnName}': {e}"
|
|
49
|
+
)
|
|
42
50
|
return component
|
|
43
51
|
|
|
44
52
|
@staticmethod
|
|
@@ -64,7 +72,16 @@ class TableUtils:
|
|
|
64
72
|
|
|
65
73
|
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber + 1}']/td[not (@data-empty-grid-message)]/div/p/a[./span[text()='{hoverText}']]"
|
|
66
74
|
# xpath=f".//table[./thead/tr/th/div[text()='{columnName}']][1]/tbody/tr[@data-dnd-name='row {rowNumber}']/td/div/p/a[./span[text()='{hoverText}']]"
|
|
67
|
-
|
|
75
|
+
try:
|
|
76
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
77
|
+
except TimeoutError as e:
|
|
78
|
+
raise TimeoutError(
|
|
79
|
+
f"Could not find link with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
80
|
+
)
|
|
81
|
+
except Exception as e:
|
|
82
|
+
raise RuntimeError(
|
|
83
|
+
f"Could not find link with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
84
|
+
)
|
|
68
85
|
component.click()
|
|
69
86
|
|
|
70
87
|
@staticmethod
|
|
@@ -90,11 +107,29 @@ class TableUtils:
|
|
|
90
107
|
# TODO rowNumber = rowNumber + 1 # Adjusting for 1-based index in XPath
|
|
91
108
|
|
|
92
109
|
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber}']/td[not (@data-empty-grid-message)]"
|
|
93
|
-
|
|
110
|
+
try:
|
|
111
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
112
|
+
except TimeoutError as e:
|
|
113
|
+
raise TimeoutError(
|
|
114
|
+
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
115
|
+
)
|
|
116
|
+
except Exception as e:
|
|
117
|
+
raise RuntimeError(
|
|
118
|
+
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
119
|
+
)
|
|
94
120
|
component.click()
|
|
95
121
|
|
|
96
122
|
xpath = f".//table[./thead/tr/th[@abbr='{columnName}']]/tbody/tr[@data-dnd-name='row {rowNumber}']/td[not (@data-empty-grid-message)]/div/div/button[./span[text()='{hoverText}']]"
|
|
97
|
-
|
|
123
|
+
try:
|
|
124
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
125
|
+
except TimeoutError as e:
|
|
126
|
+
raise TimeoutError(
|
|
127
|
+
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
128
|
+
)
|
|
129
|
+
except Exception as e:
|
|
130
|
+
raise RuntimeError(
|
|
131
|
+
f"Could not find button with hover text '{hoverText}' in column '{columnName}', row {rowNumber}: {e}"
|
|
132
|
+
)
|
|
98
133
|
component.click()
|
|
99
134
|
|
|
100
135
|
@staticmethod
|
|
@@ -142,8 +177,10 @@ class TableUtils:
|
|
|
142
177
|
component = tableObject.find_element(By.XPATH, xpath)
|
|
143
178
|
|
|
144
179
|
if component is None:
|
|
145
|
-
raise ValueError(
|
|
146
|
-
|
|
180
|
+
raise ValueError(
|
|
181
|
+
f"Could not find a column with abbr '{columnName}' in the table header."
|
|
182
|
+
)
|
|
183
|
+
|
|
147
184
|
class_string = component.get_attribute("class")
|
|
148
185
|
partial_string = "headCell_"
|
|
149
186
|
words = class_string.split()
|
|
@@ -154,8 +191,10 @@ class TableUtils:
|
|
|
154
191
|
selected_word = word
|
|
155
192
|
|
|
156
193
|
if selected_word is None:
|
|
157
|
-
raise ValueError(
|
|
158
|
-
|
|
194
|
+
raise ValueError(
|
|
195
|
+
f"Could not find a class containing '{partial_string}' in the column header for '{columnName}'."
|
|
196
|
+
)
|
|
197
|
+
|
|
159
198
|
data = selected_word.split("_")
|
|
160
199
|
return int(data[1])
|
|
161
200
|
|
|
@@ -189,6 +228,15 @@ class TableUtils:
|
|
|
189
228
|
rowNumber = rowNumber + 1
|
|
190
229
|
columnNumber = columnNumber + 1
|
|
191
230
|
xpath = f'.//table[./thead/tr/th[@abbr="{columnName}"]]/tbody/tr[@data-dnd-name="row {rowNumber}"]/td[not (@data-empty-grid-message)][{columnNumber}]/*'
|
|
192
|
-
|
|
231
|
+
try:
|
|
232
|
+
component = wait.until(EC.element_to_be_clickable((By.XPATH, xpath)))
|
|
233
|
+
except TimeoutError as e:
|
|
234
|
+
raise TimeoutError(
|
|
235
|
+
f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}"
|
|
236
|
+
)
|
|
237
|
+
except Exception as e:
|
|
238
|
+
raise RuntimeError(
|
|
239
|
+
f"Could not find component in cell at row {rowNumber}, column '{columnName}': {e}"
|
|
240
|
+
)
|
|
193
241
|
# childComponent=component.find_element(By.xpath("./*"))
|
|
194
242
|
return component
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
robo_appian/__init__.py,sha256=6u9n2W7P1IKSSr5IPGsg7LhVR1o1uYv424mXDjJLgb0,720
|
|
2
|
+
robo_appian/components/ButtonUtils.py,sha256=oezrvj3n95KE7O-O-bkyvtfzrCzD3GJw7Za9QCYnGuc,2793
|
|
3
|
+
robo_appian/components/DateUtils.py,sha256=CyG7vjeks4w_BZzLJALKMvx-wtAeV0DB65g8YRJCHb0,5120
|
|
4
|
+
robo_appian/components/DropdownUtils.py,sha256=Fh6RxepV45QMF8bIlrmPtbXE_i3kQlaHCSBVznOSxR4,7736
|
|
5
|
+
robo_appian/components/InputUtils.py,sha256=gqY5BUuqpcfLY1tn6R33Q5KpsZC7qc0KPqKflrwfBy4,5120
|
|
6
|
+
robo_appian/components/LabelUtils.py,sha256=bhMM2_lTyx8839ia__8qXVqAhTvnsgPCe7AIcEFYEN0,1654
|
|
7
|
+
robo_appian/components/LinkUtils.py,sha256=R8B4xj7V6agyz9m2GFt_jQQE8yjHPd6R5T3Pn8YRxCk,1397
|
|
8
|
+
robo_appian/components/SearchInputUtils.py,sha256=EKajPjmeuEHwY4aswHXAEhO8I4igS3icWovK_rZV6K8,3064
|
|
9
|
+
robo_appian/components/TabUtils.py,sha256=cdWTtIrzraDFR4AIesdqkMqUjuGbYKCs4n6SFHCnML0,2560
|
|
10
|
+
robo_appian/components/TableUtils.py,sha256=sEdX8voQ67h7h2QfpF_GMzjWhsZwCFC2r8g2TfVw_w0,10495
|
|
11
|
+
robo_appian/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
robo_appian/controllers/ComponentDriver.py,sha256=faeC_T06aT9XbDnUPqGwpG5ng7wULPmZigyU8TXLCu4,4354
|
|
13
|
+
robo_appian/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
robo_appian/exceptions/MyCustomError.py,sha256=DVAkytXNNQNjqyTyCjk6FFd6fr3AsBe57Y19erDSqVs,222
|
|
15
|
+
robo_appian/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
robo_appian/utils/ComponentUtils.py,sha256=uq1y6_DxH3O-m7vCvtdVE5640Wx8Je8ydA7pbKDrKVw,8398
|
|
17
|
+
robo_appian/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
robo_appian-0.0.9.dist-info/LICENSE,sha256=g-xR4dRa9_4iFkMoJmED-wE-J5hoxbk3105Knhfpjm0,1068
|
|
19
|
+
robo_appian-0.0.9.dist-info/METADATA,sha256=sG_50s_VBR6wQakiLxCrT72Tj0lotW8xGRqBW5i0xeI,4104
|
|
20
|
+
robo_appian-0.0.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
21
|
+
robo_appian-0.0.9.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
robo_appian/__init__.py,sha256=6u9n2W7P1IKSSr5IPGsg7LhVR1o1uYv424mXDjJLgb0,720
|
|
2
|
-
robo_appian/components/ButtonUtils.py,sha256=fzxVG_OWzAwwMc_L7cBE48a_aih_diMTWj4UtVfttrI,2171
|
|
3
|
-
robo_appian/components/DateUtils.py,sha256=mmvyYVgp0thiIQ2uaUiEV-aXwsyCp2d1W8hKR6j_E4M,4599
|
|
4
|
-
robo_appian/components/DropdownUtils.py,sha256=5p6Twef2dYf8Zta_SP3sIcWbaZqVI-yeMNOywHHitHw,5720
|
|
5
|
-
robo_appian/components/InputUtils.py,sha256=DwsC8G7e4lVdd2wxmUfCiX_9PDf6WXQfkrPOO2mF_B4,4393
|
|
6
|
-
robo_appian/components/LabelUtils.py,sha256=cPu4p7z-5kNTxxLY4d1dMDhNtkLnNaM88Kl6ptHvvHo,1382
|
|
7
|
-
robo_appian/components/LinkUtils.py,sha256=owUUJ4-pYDf0oRV1M146kqBfBb96rH7nCK3iA_t2Mpo,1177
|
|
8
|
-
robo_appian/components/SearchInputUtils.py,sha256=WbPrsDVWnagtz1Vkj0gftf6jfTYivODEeqz2E12oXUc,2576
|
|
9
|
-
robo_appian/components/TabUtils.py,sha256=A3Zeu5Lg7JcD_c_xCtIm7Xkjm53VTLtBhzFGLyY0FoA,2058
|
|
10
|
-
robo_appian/components/TableUtils.py,sha256=CeYYmFdOD0F78UkkVXlRmrZatPr94oSVCHyGf_fgfuw,8583
|
|
11
|
-
robo_appian/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
robo_appian/controllers/ComponentDriver.py,sha256=faeC_T06aT9XbDnUPqGwpG5ng7wULPmZigyU8TXLCu4,4354
|
|
13
|
-
robo_appian/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
robo_appian/exceptions/MyCustomError.py,sha256=DVAkytXNNQNjqyTyCjk6FFd6fr3AsBe57Y19erDSqVs,222
|
|
15
|
-
robo_appian/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
robo_appian/utils/ComponentUtils.py,sha256=uq1y6_DxH3O-m7vCvtdVE5640Wx8Je8ydA7pbKDrKVw,8398
|
|
17
|
-
robo_appian/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
robo_appian-0.0.7.dist-info/LICENSE,sha256=g-xR4dRa9_4iFkMoJmED-wE-J5hoxbk3105Knhfpjm0,1068
|
|
19
|
-
robo_appian-0.0.7.dist-info/METADATA,sha256=ZIVtC_E6hF3-e7prF5smW5SMT8vKYlbqJ4XpUnxG_XE,4104
|
|
20
|
-
robo_appian-0.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
21
|
-
robo_appian-0.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|