Get ID from SharePoint Calender Textbox

by Dec 27, 2010

I want to create a SharePoint webtest with PowerShell. Right now I had a problem with a SharePoint textbox when I create a new calender entry. The textbox had no fixed id.

It is possible to search the Fieldname "Title" and then get the id from the textbox? The following code is not working. I want to insert text in the Textbox.

($ie = New-Object -ComObject InternetExplorer.Application)

New-Object -ComObject InternetExplorer.Applicationen

$ie.Document.getElementById( "*ctl00$TextField").value = "test"

$ie.Document.getElementByName( "*ctl00$TextField").value = "test"

$ie.Document.getElementByTagName( "Titel").value = "test"



Sourcecode from the Textbox in the Internet Explorer:

<td nowrap="true" valign="top" width="190px" class="ms-formlabel"><h3 class="ms-standardheader">

<nobr>Titel<span class="ms-formvalidation" title="Dies ist ein Pflichtfeld." > *</span></nobr>


<td valign="top" class="ms-formbody">

<!– FieldName="Titel"




<span dir="none">

<input name="ctl00$m$g_27855e01_08c1_498d_b130_0b761c472fbd$ctl00$ctl05$ctl00$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_m_g_27855e01_08c1_498d_b130_0b761c472fbd_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Titel" class="ms-long ms-spellcheck-true" /><br />