How to insert text into HTML tag <p>?

  • 10 May 2023
  • 8 replies
  • 68 views

Userlevel 6
Badge +9

I run into this textarea which is not a real textarea but a <p> tag, of which the InnerText is editable. I want the BOT to automatically input some text in it but there is no SetText action for this object captured by the recorder.

 

Tried GetProperty of InnerText and assign it to a String vairable and then put some text into this String variable but not reflected in the HTML page.

 

Anybody can help on this? Thanks,

 


8 replies

Userlevel 3
Badge +7

Hi @alex zhang​ ,

 

Would you be so kind as to include few screenshots of the element you are trying to interact with?

 

Kind Regards,

Ashwin A.K

imageimageIs this helpful? Please let me know if you need more information. Thanks,

Userlevel 3
Badge +7

Hi @alex zhang​ ,

 

Could you check if this XPath returns a single match in the Inspection Window?

 

//html[@class='CSS1Compat']/p[1]

If so, then you can set it into the DOMXPath and set the Capture Operation to Click, followed by Simulate Keystrokes to enter the desired text.

 

You could also try capturing the Search textbar to generate the Set Text option and simply change the DOMXpath and see if that works, then that way you won't have to rely on the Simulate Keystrokes.

 

Kind Regards,

Ashwin A.K

Thanks and it seems working but now I encounter a bigger problem. Every time I run the capture, the web page got messed up like below. Not sure if this is because the "Text Area" is emebbed in an iframe. Can you pls help? Thanks,

image

Userlevel 3
Badge +7

Hi @alex zhang​ ,

 

I'm sorry but could you please explain what the issue is?

 

Kind Regards,

Ashwin A.K

Userlevel 3
Badge +7

Hi @alex zhang​ ,

 

Could you try using the Capture Action to simply click into the Textbox region and then use a Simulate Keystrokes to type in the text?

 

Kind Regards,

Ashwin A.K

I only did capture and click like below and it will mess up the page too. I don't understand how come AA can modify the target's layout. I thought AA is only impersonating a persion to interactive with the target. The only suspicous thing to me is that the text box region is part of the content embedded into an iframe. Thanks,

image

The web page layout is totally messed up. The toolbar at the top is missing. The search bar is going down and the red alert triangle goes up. Anyway the elements are not at their original positions now. Please compare the two screenshots below. The upper one is after running capture and lower one is before. Thanks,imageimage

Reply