I hope I can get some help with my problem.
Basically, what I want is to open a webpage in a webbrowser embedded in a Form window, and to enter a value into the textbox with the id "login-name". The code looks as follows:
PowerShell CodeDouble-click the code block to select all.
$browser = New-Object System.Windows.Forms.WebBrowser $browser.IsWebBrowserContextMenuEnabled = $true $browser.URL = "webpage-here" $browser.Width = 1325 $browser.Height = 725 $browser.Location = "25, 50" $browser.IsAccessible = $true $mainForm.Controls.Add($browser) sleep -milliseconds 5000 #wait for browser to load $browser.Document.getElementById('login-name').value = $UserObviously, I want to write the value stored in "$User" into the textbox with the ID "login-name". Please note that this is working when using the InternetExplorer Application, so my error is not a wrong ID or something like that.
The generated output just says, that the "getElementByID" returns NULL in this case. Therefore, "$User" can't be written into the textbox. The webpage itself is displayed correctly.
I hope anyone can help me with this problem. If I missed an answer to this problem which is posted in this forum, please feel free to just post the link below.
Thanks in advance