Not Recording Text in a Frame in Recording Mode
Scenario: on Resume Builder, there are 4 grids namely Employer, Job Title, Occupation and Position.
In Position, there is a field called Job Duties which is followed by a Rich Text Editor (RTE) frame
Task - Whatever I write in RTE frame, QTP needs to record it or I write a code so that I can insert text in RTE frame. This is a mandatory field.
Properties using spy - Object Hierarchy: Browser: "">Page:"">Frame:Frame
abs_x = 2118, abs_y = 272, height = 300
Class Name = Frame
html tag = OFRA,E
Note - There is no innertext, outertext. Text value is empty. Also, referring online, I have seen that lot of folks have used Object.Body,outertext method to insert Text.
But as I said, in my case, the class is Frame NOT Body and I don't have innertext or outertext
I would really appreciate if you elaborate your response by writing code.
there is a typo error:
html tag = IFRAME
One thing about HTML Rich Text Editors is there are a number of them that uses a click & keyboard jacking approach.
You might want to take a look at the source code and see how that RTE is wired up. In the situations where click/keyboard jacking is used, I generally find it easier to set the hidden input or variable that the RTE exposes than to work with the RTE itself.
David, thank you for your reply.
Please consider me as mid level user to qtp. I could not understand your reply. Can you please elaborate?
providing some more info
"title:=Rich Text Editor, ctl00_Main_content_ucIndEmpHistory_txtJobDuties_tx tWYSIWYGEditor, Press ALT 0 for help",
Think of it this way, there isn't a standard Rich Text Editor control in HTML, so some developers have created one by using more simple elements.
To do that, they created something like a window. You see a view of the rendered text on the otherside, but you're really only interacting with the glass, an invisible element that's receiving your keyboard/mouse inputs.
The problem is partially resolved with following code
Browser("NEworks").Page("NEworks - Resumé Builder_9").Frame("Frame").Object.body.outerText=" Software Testing"
Now after executing last statement, QTP is inserting "Software Testing" in Frame. However, after clicking outside of Frame to click on Next button to navigate to next screen, the text "Software Testing" got dropped.
Can anyone please help me with that?
I would try using SendKeys after clicking on it.
NoUse4aName - Thank you for your reply.
I was wondering how am I going to use Sendkey method after clicking on Next button? Can you please elaborate your reply. That way, I will have better opportunity to learn or ask further question.
The best solution is to read the documentation for the Text Editor control and work with a developer in getting it done. They have a simple hook they're using for getting content in and out of that editor.
For example, a popular one like TinyMCE, https://www.tinymce.com/
If you examine the dom, you'll notice that there is a hidden TextArea that actually tracks the content, while that frame is really only just a view.
2016-02-12_1354 - DavidLaiVdms's library
In this case, you want to edit the hidden textarea, and call the editor's refresh methods on it. Other editors are different, you have to read the documentation or ask a developer to write that hook for you.