Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WebElement
#1
Not Solved
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,
Reply
#2
Not Solved
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!
Reply
#3
Not Solved
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
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Not Solved
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,
Reply
#5
Not Solved
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 ?
Reply
#6
Not Solved
yes, webedit inside webelement. I attached the screen shot.


Attached Files Image(s)
   
Reply
#7
Not Solved
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
Reply
#8
Not Solved
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.
Reply
#9
Not Solved
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"
Reply
#10
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,954 09-28-2016, 08:58 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)