Site Element
SiteElement class improves organization of site element parameters. The class methods faciltate easy manipulation of these elements
SiteElement
Defines site elements in a structured way and provides a convenient means for element manipulations (clicking, entering text, etc.)
Source code in cuahsi_base/site_element.py
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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
clear_all_text(driver)
Uses the Ctrl+A keys combination to select all text before using BACKSPACE key to delete it
Source code in cuahsi_base/site_element.py
184 185 186 187 188 189 190 191 192 193 194 195 |
|
clear_text(driver, size)
Uses backspace to clear text from a field
Source code in cuahsi_base/site_element.py
197 198 199 200 201 202 |
|
click(driver)
Identifies an element on the page. After identification the element is then clicked.
Source code in cuahsi_base/site_element.py
102 103 104 105 106 107 |
|
double_click(driver)
Double click on element.
Source code in cuahsi_base/site_element.py
109 110 111 112 113 114 115 |
|
exists(driver)
Checks if element is visible on the page.
Source code in cuahsi_base/site_element.py
65 66 67 68 69 70 71 72 73 74 75 |
|
exists_in_dom(driver)
Checks if element exists within the DOM.
Source code in cuahsi_base/site_element.py
77 78 79 80 81 82 83 84 85 86 |
|
get_attribute(driver, attribute)
Returns any attribute of website element
Source code in cuahsi_base/site_element.py
288 289 290 291 |
|
get_attribute_hidden(driver, attribute)
Returns any attribute of website element
Source code in cuahsi_base/site_element.py
293 294 295 296 |
|
get_bag_url(driver, base_url=None)
Returns element href link, with relative links expanded into an absolute link
Source code in cuahsi_base/site_element.py
318 319 320 321 322 323 324 325 326 |
|
get_child_count(driver)
Returns the number of child elements, given a parent element specification
Source code in cuahsi_base/site_element.py
328 329 330 331 332 333 |
|
get_href(driver, base_url=None)
Returns element href link, with relative links expanded into an absolute link
Source code in cuahsi_base/site_element.py
308 309 310 311 312 313 314 315 316 |
|
get_immediate_child_count(driver)
Returns the number of immediate child elements, given a parent element specification
Source code in cuahsi_base/site_element.py
357 358 359 360 361 362 |
|
get_parent(driver)
Returns the parent element
Source code in cuahsi_base/site_element.py
352 353 354 355 |
|
get_relatives_by_xpath(driver, xpath)
Returns the relatives by xpath, given a parent element specification
Source code in cuahsi_base/site_element.py
335 336 337 338 339 340 |
|
get_text(driver)
Returns content text of website element
Source code in cuahsi_base/site_element.py
298 299 300 301 |
|
get_texts_from_xpath(driver, xpath)
Returns the text in relatives matching xpath, given a parent element specification
Source code in cuahsi_base/site_element.py
342 343 344 345 346 347 348 349 350 |
|
get_value(driver)
Returns content text of website element
Source code in cuahsi_base/site_element.py
303 304 305 306 |
|
hidden_inject_text(driver, field_text)
Enters text into a field or other input-capable html element that is hidden using send keys
Source code in cuahsi_base/site_element.py
252 253 254 255 256 257 258 |
|
iframe_in(driver)
Switches driver focus to an iframe within a page
Source code in cuahsi_base/site_element.py
277 278 279 280 |
|
iframe_out(driver)
Switches driver focus out of iframe and back to the main page
Source code in cuahsi_base/site_element.py
282 283 284 285 286 |
|
inject_text(driver, field_text)
Enters text into a field or other input-capable html element using send keys
Source code in cuahsi_base/site_element.py
244 245 246 247 248 249 250 |
|
is_selected(driver)
Checks if element is visible on the page.
Source code in cuahsi_base/site_element.py
95 96 97 98 99 100 |
|
is_visible(driver)
Checks if element is visible on the page.
Source code in cuahsi_base/site_element.py
88 89 90 91 92 93 |
|
javascript_click(driver)
Clicks an element using JavaScript
Source code in cuahsi_base/site_element.py
117 118 119 120 121 122 |
|
javascript_click_hidden(driver, silent=False)
Simulate click on a hidden element using JavaScript
Source code in cuahsi_base/site_element.py
124 125 126 127 128 129 |
|
javascript_fill_hidden_text(driver, text)
Set text using JavaScript for a potentially hidden element
Source code in cuahsi_base/site_element.py
131 132 133 134 135 136 |
|
loc_hidden(driver, silent=False)
Identifies potentially hidden element on page, based on an element locator.
Source code in cuahsi_base/site_element.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
loc_it(driver)
Identifies element on page, based on an element locator. Waits until an element becomes available & visible in DOM, and then until it becomes clickable.
Source code in cuahsi_base/site_element.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
multi_click(driver)
Clicks an element while holding the control key, as to enable a multi-selection
Source code in cuahsi_base/site_element.py
152 153 154 155 156 157 158 159 160 161 162 |
|
passive_click(driver)
Identifies an element on the page. After identification the element is then clicked, regardless if it is "interactable" or not
Source code in cuahsi_base/site_element.py
176 177 178 179 180 181 182 |
|
range_click(driver)
Clicks an element while holding the control key, as to enable a range selection
Source code in cuahsi_base/site_element.py
164 165 166 167 168 169 170 171 172 173 174 |
|
scroll_right(driver)
Scroll right using Keys.ARROW_RIGHT and a hold of one second
Source code in cuahsi_base/site_element.py
230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
scroll_to(driver)
After element identification, the window is scrolled such that the element becomes visible in the window
Source code in cuahsi_base/site_element.py
223 224 225 226 227 228 |
|
scroll_to_hidden(driver)
After element identification, the window is scrolled such that the element becomes visible in the window
Source code in cuahsi_base/site_element.py
216 217 218 219 220 221 |
|
select_option(driver, select_choice)
Selects an option from a dropdown element
Source code in cuahsi_base/site_element.py
204 205 206 207 208 |
|
select_option_text(driver, select_choice)
Selects an option from dropdown given visible text
Source code in cuahsi_base/site_element.py
210 211 212 213 214 |
|
send_caps(driver, field_text)
Enters capitalized text into a field or other input-capable html element using send_keys_to_element
Source code in cuahsi_base/site_element.py
260 261 262 263 264 265 266 267 268 |
|
set_path(driver, field_text)
Enters text into a field or other input-capable html element using send keys, best for setting path to files for upload
Source code in cuahsi_base/site_element.py
270 271 272 273 274 275 |
|
submit(driver)
Send ENTER to element, simulates submit
Source code in cuahsi_base/site_element.py
138 139 140 141 |
|
submit_hidden(driver)
Send ENTER to element that is perhaps hidden, simulates submit
Source code in cuahsi_base/site_element.py
143 144 145 146 147 148 149 150 |
|
SiteElementsCollection
Provides a way to locate all page elements which are identified by a common locator.
Source code in cuahsi_base/site_element.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
|
loc_them(driver)
Finds all elements on a page that match a given locator. Waits until all elements become visible in a DOM.
Source code in cuahsi_base/site_element.py
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|