Micro Focus QTP (UFT) Forums
WebElement - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: WebElement (/Thread-WebElement)

Pages: 1 2


WebElement - Langxii - 05-26-2011

Hi QTP Experts,

I tried to enter value from the application by selecting the value from datatable ....
THere is no problem when i set value (by select from datatable) on Webedit. (it means that the value is set on the webedit there). But the problem is:
After i click Save button on my application , the value is gone (it means that the value doesn't save ). Here is my script:

Code:
b= datatable ("version", "Action1")
Browser("...........").Page("....").Webelement("WebResource_2").Click
Set oedit = Browser("    ").Page(" ").WebElement("Webresource_2")
Oedit.object.innnertext = b
Browser("    "(..................Webbutton("save").click.

Would you please help as soon as possible?


Thanks,


RE: WebElement - rajpes - 07-06-2011

You mentioned in the beginning that you will enter value into webedit
Then why you are creating object of an webelement?
Moreover it's the "set" method which writes value in edit fields!


RE: WebElement - basanth27 - 07-07-2011

Not Necessarily. There are custom objects which are text editable but are not webedit.

Langxii -
Try a click on the webelement after you have set the innertext value.

If that does not work, try the,
Code:
Setting.webpackage("ReplayType") =2
b= datatable ("version", "Action1")
Browser("...........").Page("....").Webelement("WebResource_2").Click
Set oedit = Browser(" ").Page(" ").WebElement("Webresource_2")
Oedit.object.innnertext = b
Browser(" "(..................Webbutton("save").click
setting.webpackage("ReplayType")=1



RE: WebElement - Langxii - 07-08-2011

Thanks for your reply. I tried your code but the value doesn't set to webelement. It does click on grid but it doesn't set value. Would you have different solution? Let me know please.
Using Set doesn't work.
Code:
Browser("...........").Page("....").Webelement("WebResource_2").Click
Browser("...........").Page("....").Webedit("WebEdit").Set a

Thanks,


RE: WebElement - rajpes - 07-08-2011

can you attach the screenshot of the page?i don't understand what you mean by "the value doesn't set to webelement",Is that a webedit inside a webelement ?


RE: WebElement - Langxii - 07-09-2011

yes, webedit inside webelement. I attached the screen shot.


RE: WebElement - rajpes - 07-09-2011

1.If you manually enter values(without using qtp), do they get saved?
2.After executing the line Oedit.object.innnertext = b, do you see that value on page? if you are not sure, put a breakpoint on next line of it and let me know


RE: WebElement - Langxii - 07-12-2011

1.If you manually enter values(without using qtp), do they get saved?
2.After executing the line Oedit.object.innnertext = b, do you see that value on page? if you are not sure, put a breakpoint on next line of it and let me know
[/quote]

Thanks for your reply.

1. Yes, it saved when entering value by manually
2. Yes I put break on next line, i don't see the value entered after executing Oedit.object.innnertext = b
3. It seems that QTP has problem with webedit or webelement. I use this code below, the value sometimes entered on first grid and second grid , and sometime the value entered on first grid but not on second grid.
Browser("").Page("").WebElement("WebResource_2").Click
Browser("").Page("").WebEdit("WebEdit").Set b
Browser("Customer Inquiry").Page("").WebEdit("WebEdit").Object.innerText ="1.1"

Can you show the different way to enter value by using webtable by using column , row.?
Please let me know.
Thanks.



RE: WebElement - rajpes - 07-12-2011

add the webtable to object repostitory.
If the webedit is in 1st row 1st column,

Code:
Browser("").Page("").WebTable("").ChildItem(1,1,"WebEdit",0).Set "1.1"



RE: WebElement - Langxii - 07-14-2011

I got run time error on this line below
Run error - Object required: 'Browser(...).Page(...).WebTable(...).ChildItem(...)'
Line (39): "Browser("").Page("").WebTable("WebTable").ChildItem(1,1,"WebEdit",0).set "1.1"".
How can i find row # (1), column (1) and index (0) ?
If i enter Catalog ID , it should be CHilditem(1,1,"WebEdit",0).Set "ABC"
If i enter version, it should be Childitem(1,2, "Webedit", 0).Set"1.1"
Would you help please?

Thanks