Unable to update data in webportal input box

hi All,

I have a web application which has few input boxes to enter data in. These input boxes might already have data in it, in which case, I need to clear off the existing data and update the new data in those boxes. The problem I am facing is, when I use a write stage to enter the new data, it is overriding the existing data which is what I wanted but when I tried to save the data, the data is not saved. I know that some portals do not recognize the data entered using write stage so I tried to use "Global Send Keys" to send write data into the input box. Below is the approach I tried -

1) Activate the application (after spying it using Win32 mode).
2) Put cursor in the input box using "Click Center" option in navigate stage (I spyed the input box using HTML mode).
3) Use "Global Send Keys" in Navigate stage to enter the data in the input box.

I am facing couple of issues in this scenario - I am able to activate the application but the "Click Center" option is not working for some reason. I am not seeing the cursor in the box where I sent "Click Center" action so the "Global Send Keys" stage is writing data in another input box (which is selected by default) which is not what I intended.

I assumed the issue might be because of using HTML spyed input box being used in "Click Center" so I tried to spy the input box using AA mode but I am not able to find the unique combination of attributes that can identify the input box I wanted using AA mode.

In this scenario, can someone help me with the approach to be followed.

1) Do I need to spy the input box (in which I want to enter the data in) using AA mode only to use "Click Center" option or wil lHTML mode also work. If HTML mode works, what mistake am I doing in this case?
2) How do I clear off the data which is existing in the input box before using "Global Send Keys" to update the input box with new data.

One approach to clear off existing data in the input box is to send "Backspace" after putting cursor in that box but I am not sure if I use "Click Center" option if the cursor will be placed at the end of the data in the box or in the middle of the data. If the cursor is placed in the middle, even after sending "Backspace" the entire data might not be cleared.

Highly appreciate any help how I need to approach this situation. Attached the screen shot of the web portal and the input boxes I am referring to.
 

Attachments

  • Webpage.png
    10.8 KB · Views: 32

VJR

Well-Known Member
Hi Highspirits,

"I am not seeing the cursor in the box where I sent "Click Center" action"
Is there some other action like 'Focus'. Try to use that.
If not, is there another control prior to it (sometimes even a label works) where you can place the focus on that control and then do a Sendkeys TAB so that it goes to the right textbox.

"1) Do I need to spy the input box (in which I want to enter the data in) using AA mode only to use "Click Center" option or wil lHTML mode also work. If HTML mode works, what mistake am I doing in this case?"
In a general scenario HTML mode works for a web application, but it also depends on how the webpage is. On some websites AA mode works where HTML does not. So it is a matter of trial and error and to see which mode and a combination of which attributes finally work out.


"2) How do I clear off the data which is existing in the input box before using "Global Send Keys" to update the input box with new data."
If not already done, along with Global Send Keys also try Global Send Keys Events.


"when I use a write stage to enter the new data, it is overriding the existing data which is what I wanted but when I tried to save the data, the data is not saved."
Right click on the webpage and do a View Source and see the html <input> tags for the textbox. Try to see what is exactly happening. See if the name/id of the textbox in the view source is the same as the one captured in your Application Modeller. Some websites show up two bordered areas while spying a textbox. So see if there is a textbox within another textbox, slowly and gradually hover your mouse over them while spying.

Also see in the source code, if after typing the text in the textbox whether it is written to another hidden textbox and that is the textbox that finally gets submitted.
Also sometimes the original textbox in the html is set as readonly (although it is writable) and then some javascript function is invoked to interact with the data written on the texbox before finally getting submitted. So something to see there too.
 
Hi VJR,

Thank you for the reply. I was able to identify the combination which uniquely identified the input box using AA mode. After that, I used below actions to write data into the box -

1) Activate the application (spyed the window using WIN 32)
2) Focus (Spyed the element using AA)
3) Global Send Keys to send "^a" (CTRL+a to select all the existing content in the input box)
4) Global Send Keys to send "{BACKSPACE}" (to delete the existing content in the input box)
5) Global Send Keys to send the required data into the text box (with an interval of 0.1 sec).

This solved the issue but the challenge I am having is that all the actions that are performed using AA elements are taking more time (than HTML actions) so the overall solution is also taking more time to complete. This is not a big issue for me now but something that I need to work on to see if there is any other way to speed up the process. Any thoughts on this approach and tips to speed up the process?
 

VJR

Well-Known Member
Hi Highspirits,

Active Accessibility mode at times does take time to process the stages. Even while spying most of the times AA mode takes time to even highlight and retrieve the attributes in the Application Modeller. So it looks like it is by design as the AA mode is an API that retrieves the "in-depth" attributes specially used by the operating system for visually impaired or people with hearing loss or other physical disability.
- https://en.wikipedia.org/wiki/Microsoft_Active_Accessibility
- https://msdn.microsoft.com/en-us/library/ms971350.aspx

If Html mode is not working on your web application then AA mode should be good to go and far much better than going via the Region mode way.
 
Top