forked from 2gis/Winium.Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Command Execute Script
ssratkevich edited this page May 12, 2022
·
2 revisions
Script starting with "input:" prefix supports following commands:
-
ctrl_click- simulate pressing key combo ctrl+click.
Arguments:-
element- element on element on which simulated
-
-
brc_click- simulate pressing click to element center (by bounding rectangle).
Arguments:-
element- element on element on which simulated
-
Examples
element = self.driver.find_element_by_id("ClickedElement")
self.driver.execute_script("input: ctrl_click", element)Script starting with "automation:" prefix supports following commands:
-
ValuePattern.SetValue- sets property on element to specified value. Arguments:-
element- element on wich attribute will be set -
value- value to be set
-
-
ScrollItemPattern.ScrollIntoViewand shorthandScrollIntoView- scroll given element into view.
Arguments:-
element- element to show. If element supportsScrollItemPatternpattern this is only required argument -
scrollableParentElement- parent element which supportsScrollPatternpattern.
-
-
SelectionItemPattern.Select- select element which supportsSelectionItemPatternpattern.
Arguments:-
element- element which supportsSelectionItemPatternpattern.
-
-
ExpandCollapsePattern.Expand- expands or collapses given element.
Arguments:-
element- element which supportsExpandCollapsePatternpattern. -
expandMode- optional boolean value (default istrue) indicating what operation mode:-
true(default) - expand element -
false- collapse element
-
-
-
SetFocus- sets focus on given element.
Arguments:-
element- element which supports setting focus on it (ex.: button, textbox, etc.).
-
Examples
date_time_picker = self.driver.find_element_by_id("DateTimePicker")
self.driver.execute_script("automation: ValuePattern.SetValue", date_time_picker, "29.06.15 05:00")