I am trying to automate a webpage.
I was able to do login and click on the page. After i click in the new page i need to enter "Name" into it, but its not working getting : Microsoft VBScript runtime error '800a01a8' Object required: 'objIE.document.getElementById(..)
below is the code i am using
struser = "user"
strPass = "pswd"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "http://myurl"
While objIE.Busy = True
WScript.Sleep 100
Wend
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
objIE.Document.all.User.value = struser
objIE.Document.all.Password.value = strPass
objIE.Document.Forms(0).Submit()
While objIE.Busy = True
WScript.Sleep 100
Wend
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
objIE.Document.all.drop_mainmenu.click()
objIE.Document.all.BOX.value = "12"
objIE.Document.all.Button.Click()
While objIE.Busy = True
WScript.Sleep 100
Wend
While objIE.ReadyState <> 4
WScript.Sleep 100
Wend
'dim srch
'objIE.Document.getElementsByName("0_58").value = "Long"
'srch.value = "Long"
set el = objIE.document.getElementById("C0_58")
'If el.value is nothing Then
set el.value = "Long"
'End If
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^%L"
below is the snippet of source code for that field.
enter code here<input name="0_58" tabindex="6" title="Alpha Name" class="textfield" id="C0_58" style="width: 218px;
vertical-align: top; cursor: auto;" onmouseover="updateHelpCursor('',this)" onhelp="hp('0_58')"
onfocus="FCHandler.onFocus(this,'',false)" onblur="FCHandler.onExit(this,false,'',false)"
type="text" maxlength="40" value=" " htmlpostflag="false">
enter code here