MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GetExecutor

Method GetExecutor

dotnet/src/webdriver/RelativeBy.cs:400–427  ·  view source on GitHub ↗
(ISearchContext context)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected