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

Method IsInteractable

cpp/iedriver/Element.cpp:211–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211bool Element::IsInteractable() {
212 LOG(TRACE) << "Entering Element::IsInteractable";
213
214 bool result = false;
215
216 // The atom is just the definition of an anonymous
217 // function: "function() {...}"; Wrap it in another function so we can
218 // invoke it with our arguments without polluting the current namespace.
219 std::wstring script_source(L"(function() { return (");
220 script_source += atoms::asString(atoms::IS_INTERACTABLE);
221 script_source += L")})();";
222
223 CComPtr<IHTMLDocument2> doc;
224 this->GetContainingDocument(false, &doc);
225 Script script_wrapper(doc, script_source, 1);
226 script_wrapper.AddArgument(this->element_);
227 int status_code = script_wrapper.Execute();
228
229 if (status_code == WD_SUCCESS) {
230 result = script_wrapper.result().boolVal == VARIANT_TRUE;
231 } else {
232 LOG(WARN) << "Failed to determine is element enabled";
233 }
234
235 return result;
236}
237
238bool Element::IsFocusable() {
239 LOG(TRACE) << "Entering Element::IsFocusable";

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