Question

Error while raising raise event method

While i raise event on textbox after entering text, i'm using "OnPaste" method to recognize the text .

But i'm getting error "Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME"

Tried different events under raise event , but everytime i'm getting same error as mentioned above.

Application which i'm using is built on angular.

Correct Answer
June 24, 2019 - 11:12am

In your script you have two parameters -

  1. type 
  2. eventname

In your automation, you are passing the eventname into the wrong parameter. "paste", "select", "change", etc... are all going into parameter 1 (type)... so it is not executing correctly. They need to go into "parameter1" instead of "parameter0".

Did you try testing the script at the bottom of the document I attached? There probably needs to be text in the textbox before it activates...so set the text first. If in automation... use the text property and set to something arbitrary. If in F12 Developer Tools Console, set the value text property, like  target.text="a"; or target.value="a"; then try the raiseEvents function with the noIdeaEvents and the keyEvents on that element.

Everything is easier to test outside of Studio... I really recommend first testing everything in the F12 Dev Tools... leave Studio out until you figure out what you need.

Comments

Keep up to date on this post and subscribe to comments

June 12, 2019 - 10:32am

@Mitchell I have seen you have worked on similar issue you have looked into

Question(Text box value not being recognised and raise event error)

Request to help on this issue.

Pega
June 12, 2019 - 10:40am

That error usually means an error is thrown from the webpage. Check the F12 Developer Tools console for an error message after trying invoke one of those methods.

Also attached a document that might help you.

June 23, 2019 - 2:12pm
Response to Mitchell

Thanks @Mitchell but couldn't complete to raise the event for one text box after setting value.

can you please help me for this issue @Mitchell.

Manually when you start typing in the text box, it gives prompt we can select from there.

When we set value thru automation, i couldn't get prompt by raising thru raise event as well as execute/invoke script.

Attaching developer option, java script and automation screen prints i have tried.Please help if anything needs to correct in script.

Pega
June 24, 2019 - 11:12am
Response to AnjiR976

In your script you have two parameters -

  1. type 
  2. eventname

In your automation, you are passing the eventname into the wrong parameter. "paste", "select", "change", etc... are all going into parameter 1 (type)... so it is not executing correctly. They need to go into "parameter1" instead of "parameter0".

Did you try testing the script at the bottom of the document I attached? There probably needs to be text in the textbox before it activates...so set the text first. If in automation... use the text property and set to something arbitrary. If in F12 Developer Tools Console, set the value text property, like  target.text="a"; or target.value="a"; then try the raiseEvents function with the noIdeaEvents and the keyEvents on that element.

Everything is easier to test outside of Studio... I really recommend first testing everything in the F12 Dev Tools... leave Studio out until you figure out what you need.

June 24, 2019 - 11:51pm
Response to Mitchell

Thanks so much for your quick response @Mitchell . Issue is resolved.