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

Method IsEditable

cpp/iedriver/Element.cpp:506–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506bool Element::IsEditable() {
507 LOG(TRACE) << "Entering Element::IsEditable";
508
509 bool result = false;
510
511 // The atom is just the definition of an anonymous
512 // function: "function() {...}"; Wrap it in another function so we can
513 // invoke it with our arguments without polluting the current namespace.
514 std::wstring script_source(L"(function() { return (");
515 script_source += atoms::asString(atoms::IS_EDITABLE);
516 script_source += L")})();";
517
518 CComPtr<IHTMLDocument2> doc;
519 this->GetContainingDocument(false, &doc);
520 Script script_wrapper(doc, script_source, 1);
521 script_wrapper.AddArgument(this->element_);
522 int status_code = script_wrapper.Execute();
523
524 if (status_code == WD_SUCCESS) {
525 result = script_wrapper.result().boolVal == VARIANT_TRUE;
526 } else {
527 LOG(WARN) << "Failed to determine is element enabled";
528 }
529
530 return result;
531}
532
533int Element::GetClickLocation(const ElementScrollBehavior scroll_behavior,
534 LocationInfo* element_location,

Callers 1

ExecuteInternalMethod · 0.80

Calls 6

GetContainingDocumentMethod · 0.95
asStringFunction · 0.85
LOGClass · 0.50
AddArgumentMethod · 0.45
ExecuteMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected