Manipulate a Website textbox

Jul 24, 2013 at 3:41 PM
Hello,

I was wondering if you would be able to help me with adding text to a textbox on a website. Here is my line of code that i am trying to use:
Get-UIAWindow -ProcessName chrome | Get-UIATextBox -AutomationID 'textboxId' | Set-UIAControlText 'This is the text i am trying to insert'
The code above comes up with an error saying this:
Get-UIATextBox : Get-UIATextBox: timeout expired for control with class: + ' ', control type: 'Edit', title: ' ', automationId: 'textboxId', value: ' '
at line:1 char:51
+ Get-UIAWindow -ProcessName chrome | Get-UIATextBox <<<< -AutomationID 'textboxId' | Set-UIAControlText -Text 'This is the text i am trying to insert'
+CategoryInfo            : OperationTimeout: (:) [Get-UIATextBox], Exception
+FullyQualifiedErrorId   : ControlIsNull, UIAutomation.Commands.GetUIATextBoxCommand
I am pretty new to using this so any input would be much appreciated!
Coordinator
Jul 24, 2013 at 5:33 PM
Hi joepriff,
I can only disappoint you here: apart form IE and Firefox, Chrome's page content is unavailable for UI Automation. To observe this fact, you can run UIAutomationSpy.exe and hover over Chrome window. Only tabs and the window itself should be available to the spy.

You might choose IE or FF to automate you website, or use Selenium (SePSX, for example) to access controls in Chrome.

Alexander
Jul 24, 2013 at 6:12 PM
Alexander,
I was unaware that it is not available for chrome. I will just use IE (as much as I may dislike it). I was just using chrome to begin with since it is my default browser.

I just tried running the same code:
Get-UIAWindow -ProcessName iexplore| Get-UIATextBox -AutomationID 'textboxId' | Set-UIAControlText 'This is the text i am trying to insert'
But it came up with the same error that I had above. Any suggestions with how i should proceed?

Thanks again for your help!

-Joe
Sep 21, 2013 at 7:11 AM
You need to enable accessibility features in Chrome first:
http://www.chromium.org/developers/design-documents/accessibility

Basically start the browser with --force-renderer-accessibility parameter and you will be able to manipulate webpages via UIA.
Oct 31, 2014 at 4:43 AM
To manipulate a textbox, you should know how to customize the input control with this guide here.