I am facing an error, “Error HRESULT E_FAIL has been returned from a call to a COM component”, when I try to “Set text” into an object on Internet Explorer.
Following is my robot.
- Log in to a legacy web-based system (Only available on IE)
- Simulate clicking a menu and jump to lv2 page
- Simulate clicking a menu and jump to lv3 page
- Set text into an object
- Simulate clicking an image anchor to bring up an input-help window
- Set text into an object of the window opened in step 5.
- Simulate clicking a button to submit the data
The result is that, both step 4 and step 6 failed. “Error HRESULT E_FAIL has been returned from a call to a COM component” showed.
When I tried to find the reason, I found,
a. Everything will be okay when I run just step 4 ~ 7.
b. I tried to add “On element appear” to prevent “Set text” runs before the page becomes ready, but it didn’t help.
c. I use “Set to clipboard” > “Set focus” > “Send hotkey (Ctrl+v)” instead of “Set text”, it succeeded.
Although the method “c” above helps avoid that error, I am not willing to do it every time I want to “Set text” into an element.
Do you have any idea why the error happens and how solve it correctly?
Thanks in advance