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

Method GetSerializableRoot

dotnet/src/webdriver/RelativeBy.cs:336–359  ·  view source on GitHub ↗
(object root)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected