I am trying to set a value for a web form. I have followed multiple tutorials with no success. I get the following error
Exception setting "value": "The property 'value' cannot be found on this object. Verify that the property exists and can be set."
Here is my code:
$ie = New-Object -Com "InternetExplorer.Application" $ie.Navigate("https://*******************/ccmadmin/showHome.do") $ie.Visible = $true while($ie.ReadyState -ne 4) {start-sleep -m 100} $ie.Document.getElementsByName("j_username").value = "aaaaa"
When I get the properties I get the following:
className : id : tagName : INPUT parentElement : System.__ComObject style : System.__ComObject onhelp : onclick : ondblclick : onkeydown : onkeyup : onkeypress : onmouseout : onmouseover : onmousemove : onmousedown : onmouseup : document : mshtml.HTMLDocumentClass title : language : onselectstart : sourceIndex : 75 recordNumber : lang : offsetLeft : 1 offsetTop : 2 offsetWidth : 142 offsetHeight : 19 offsetParent : System.__ComObject innerHTML : innerText : outerHTML : outerText : parentTextEdit : System.__ComObject isTextEdit : True filters : System.__ComObject ondragstart : onbeforeupdate : onafterupdate : onerrorupdate : onrowexit : onrowenter : ondatasetchanged : ondataavailable : ondatasetcomplete : onfilterchange : children : System.__ComObject all : System.__ComObject scopeName : HTML onlosecapture : onscroll : ondrag : ondragend : ondragenter : ondragover : ondragleave : ondrop : onbeforecut : oncut : onbeforecopy : oncopy : onbeforepaste : onpaste : currentStyle : System.__ComObject onpropertychange : tabIndex : 0 accessKey : onblur : onfocus : onresize : clientHeight : 17 clientWidth : 140 clientTop : 1 clientLeft : 1 readyState : complete onreadystatechange : onrowsdelete : onrowsinserted : oncellchange : dir : scrollHeight : 17 scrollWidth : 140 scrollTop : 0 scrollLeft : 0 oncontextmenu : canHaveChildren : False runtimeStyle : System.__ComObject behaviorUrns : System.__ComObject tagUrn : onbeforeeditfocus : isMultiLine : False canHaveHTML : False onlayoutcomplete : onpage : onbeforedeactivate : contentEditable : inherit isContentEditable : True hideFocus : False disabled : False isDisabled : False onmove : oncontrolselect : onresizestart : onresizeend : onmovestart : onmoveend : onmouseenter : onmouseleave : onactivate : ondeactivate : onmousewheel : onbeforeactivate : onfocusin : onfocusout : uniqueNumber : 1 uniqueID : ms__id1 nodeType : 1 parentNode : System.__ComObject childNodes : System.__ComObject attributes : System.__ComObject nodeName : INPUT nodeValue : firstChild : lastChild : previousSibling : nextSibling : ownerDocument : mshtml.HTMLDocumentClass prefix : localName : namespaceURI : textContent : dataFld : dataSrc : dataFormatAs : role : ariaBusy : ariaChecked : ariaDisabled : ariaExpanded : ariaHaspopup : ariaHidden : ariaInvalid : ariaMultiselectable : ariaPressed : ariaReadonly : ariaRequired : ariaSecret : ariaSelected : ie8_attributes : ariaValuenow : ariaPosinset : ariaSetsize : ariaLevel : ariaValuemin : ariaValuemax : ariaControls : ariaDescribedby : ariaFlowto : ariaLabelledby : ariaActivedescendant : ariaOwns : ariaLive : ariaRelevant : ie9_tagName : ie9_nodeName : onabort : oncanplay : oncanplaythrough : onchange : ondurationchange : onemptied : onended : onerror : oninput : onload : onloadeddata : onloadedmetadata : onloadstart : onpause : onplay : onplaying : onprogress : onratechange : onreset : onseeked : onseeking : onselect : onstalled : onsubmit : onsuspend : ontimeupdate : onvolumechange : onwaiting : constructor : onmspointerdown : onmspointermove : onmspointerup : onmspointerover : onmspointerout : onmspointercancel : onmspointerhover : onmslostpointercapture : onmsgotpointercapture : onmsgesturestart : onmsgesturechange : onmsgestureend : onmsgesturehold : onmsgesturetap : onmsgesturedoubletap : onmsinertiastart : onmstransitionstart : onmstransitionend : onmsanimationstart : onmsanimationend : onmsanimationiteration : oninvalid : xmsAcceleratorKey : spellcheck : False onmsmanipulationstatechanged : oncuechange : type : text value : name : j_username status : False form : System.__ComObject size : 20 maxLength : 128 defaultValue : readOnly : False indeterminate : False defaultChecked : False checked : False border : vspace : 0 hspace : 0 alt : src : lowsrc : vrml : dynsrc : complete : False loop : 1 align : width : 0 height : 0 start : fileopen accept : useMap : selectionStart : selectionEnd : ie8_src : ie8_lowsrc : ie8_vrml : ie8_dynsrc : min : max : step : valueAsNumber :
Any thoughts on why I can’t set the value?