(object root)
| 334 | } |
| 335 | |
| 336 | private static object GetSerializableRoot(object root) |
| 337 | { |
| 338 | if (root == null) |
| 339 | { |
| 340 | throw new ArgumentNullException(nameof(root), "object to serialize must not be null"); |
| 341 | } |
| 342 | |
| 343 | if (root is By asBy) |
| 344 | { |
| 345 | return asBy; |
| 346 | } |
| 347 | |
| 348 | if (root is IWebElement element) |
| 349 | { |
| 350 | return element; |
| 351 | } |
| 352 | |
| 353 | if (root is IWrapsElement wrapper) |
| 354 | { |
| 355 | return wrapper.WrappedElement; |
| 356 | } |
| 357 | |
| 358 | throw new WebDriverException("Serializable locator must be a By, an IWebElement, or a wrapped element using IWrapsElement"); |
| 359 | } |
| 360 | |
| 361 | private static object GetSerializableObject(object root) |
| 362 | { |
nothing calls this directly
no outgoing calls
no test coverage detected