Returns the parent element. If element is a string, then finds element first via selector.
(self, element, by="css selector", timeout=None)
| 2115 | self.set_attributes('[target="_blank"]', "target", "_self") |
| 2116 | |
| 2117 | def get_parent(self, element, by="css selector", timeout=None): |
| 2118 | """Returns the parent element. |
| 2119 | If element is a string, then finds element first via selector.""" |
| 2120 | if self.__is_cdp_swap_needed(): |
| 2121 | return self.cdp.get_parent(element) |
| 2122 | if isinstance(element, str): |
| 2123 | if not timeout: |
| 2124 | timeout = settings.LARGE_TIMEOUT |
| 2125 | element = self.wait_for_element_present( |
| 2126 | element, by=by, timeout=timeout |
| 2127 | ) |
| 2128 | return element.find_element(by="xpath", value="..") |
| 2129 | |
| 2130 | def get_property( |
| 2131 | self, selector, property, by="css selector", timeout=None |
nothing calls this directly
no test coverage detected