Highlighted
Absent Member.
Absent Member.
316 views

Entering text inside an object that is not a WebEdit

Hello,

 

I'm having trouble with entering text inside an object that is not a WebEdit. The application works first by clicking on the object, which then brings up a text editor (similar to the one I am using to write this post). Since there is not a Set method, I've tried to change the object's innerText:

 

Browser("").Page("").WebElement("").Object.innerText = "test"

 

The test is able to run without any run errors, but the text doesn't show up. Is there a way I can enter text inside this type of application?

 

Thanks!

0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

Re: Entering text inside an object that is not a WebEdit

use fireevent methods on webElement object and then use object.innertext statement.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Entering text inside an object that is not a WebEdit

This is a case with a specific type of webedit where the innertext is a different property than text displayed but is dependent on that. Not the other way round. Kind of a bad HTML usually generated by automatic dev tools In this scenario, it is configured to set the value of innertext property as per the text display(Which is not a property, but the value directly on the object tag in DOM), but not the other way round. This means that if the value of your textbox is being used somewhere by another object, it would be fine till the page refreshes in which case it will take the display value as null and rested the inner text. For the above scenario, you can use Browser("").Page("").WebElement("").Object.type method but it has a few shortcomings like:-Wont work if the system gets locked, cannot interfere with system while scripts are running. One benefit is that if there is a java script associated with the control, it will be automatically triggered.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.