简体   繁体   中英

Change the child item innertext in a webtable in uft?

Please help me in changing the innertext of a WebElement from a Webtable . Below is the code which I am trying

SET OBJECT = Browser("Browser").Page("pgeMemberProgram").WebTable("Member Summary").ChildItem(18, 2, "WebElement", 9)

OBJECT.set "ABCD"

Every time I am trying this it says, OBJECT is not set.

WebElement objects don't have a Set method. In order to set their text you have to use the .Object property in order to access the underlying HTML object.

Note that innerText is not standard HTML, you should use textContent . Most browsers support textContent but if you're using older versions of IE you may need to use innerText .

You may be also facing problems due to use of OBJECT as the variable name, try the following:

Set webElem = Browser("Browser").Page("pgeMemberProgram").WebTable("Member Summary").ChildItem(18, 2, "WebElement", 9)

webElem.Object.textContent = "ABCD"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM