(ISearchContext context)
| 398 | } |
| 399 | |
| 400 | private static IJavaScriptExecutor GetExecutor(ISearchContext context) |
| 401 | { |
| 402 | IJavaScriptExecutor? executor = context as IJavaScriptExecutor; |
| 403 | if (executor != null) |
| 404 | { |
| 405 | return executor; |
| 406 | } |
| 407 | |
| 408 | IWrapsDriver? current = context as IWrapsDriver; |
| 409 | while (current != null) |
| 410 | { |
| 411 | IWebDriver driver = current.WrappedDriver; |
| 412 | executor = driver as IJavaScriptExecutor; |
| 413 | if (executor != null) |
| 414 | { |
| 415 | break; |
| 416 | } |
| 417 | |
| 418 | current = driver as IWrapsDriver; |
| 419 | } |
| 420 | |
| 421 | if (executor == null) |
| 422 | { |
| 423 | throw new ArgumentException("Search context must support JavaScript or IWrapsDriver where the wrapped driver supports JavaScript", nameof(context)); |
| 424 | } |
| 425 | |
| 426 | return executor; |
| 427 | } |
| 428 | } |
nothing calls this directly
no outgoing calls
no test coverage detected