Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am automating our web browser task through powershell. I have a text area on a page where we insert our event proc and then click on submit. I am able to add the text value on the text area and it populates on the IE window page as well but when I click confirm it all through powershell it shows error saying, Please enter a value.

However, If a try adding the same event proc on the text area manually and click confirm. it works.

PS Script:

??($obj.Document.getElementsByTagName("textarea") | select -First 1 ).value = "Events(Startup).group=add+=Administrators /g=A645121"
#click on confirm
$conf = $obj.Document.getElementsByTagName("button") | Where-Object {$_.innertext -eq 'Confirm'}
$conf.click()


HTML Element details:

<textarea data-bind="value: CacheDbControlData, valueUpdate: ['afterpaste'], disable: !isSelectedClass('unformatted')"></textarea>

Any help would be really appreciated.



Regards,

Javed

What I have tried:

PS Script:

??($obj.Document.getElementsByTagName("textarea") | select -First 1 ).value = "Events(Startup).group=add+=Administrators /g=A645121"
#click on confirm
$conf = $obj.Document.getElementsByTagName("button") | Where-Object {$_.innertext -eq 'Confirm'}
$conf.click()
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900