Question
OpenSpan 7.1 How to automate dynamic HTML controls created by javascript
I am trying to automate a web page that creates controls dynamically using javascript. (for example, the editing area of HTML Rich Text Editor)
These dynamic controls only appear when a text box (this one is static) on the page is focused either by clicking on it or using TAB key to move the focus to it.
It is difficult to intterogate these dynamic controls because they will disappear as soon as the browser window lose the focus.
Initially, I thought that it maybe possible to display and navigate through these dynamic controls by firing a serises of key strokes using "SendKeys" method, however, it turns out that "SendKeys" method doesn't appear in the method list of a HTML control which class is OpenSpan.Adapters.Web.Controls.
Any ideas for automating dynamic HTML controls created by javascript ?
Chunzhi
Chunzhi,
There is a possibility that the controls are still on the page even when the text box is not in focus. They are likely hidden. I would suggest to set focus to the text box manually without OpenSpan, open the developer tools through IE search for the desired control using select element tool. Once you identify the unique attributes of the control go to Pega Studio and search for the same control within the web controls tab.
There is an alternative way to interrogate controls without the use of the bullseye. The alternative method is finding the desired control through the list of web controls underneath the Web Controls tab.
You must first list the browsers and frames. Select the browser that you suspect the control to be listed under. Once you select the browser/frame. Click the List Web Controls button underneath. If the page is full of controls, it may take a while for the list of controls to populate in the list view. Be patient. You can narrow down the list of controls returned through the filter combo box.
When selecting the web controls after they have returned, you can view the properties of the control to the right panel. Check to see if the selected control contains the list of attributes that you found when searching for the control using the IE developers tools. If you find the correct web control, right click the identified web control in the list and select "create control" in the context menu. This web control should now appear in your object explorer for automation.