Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
descriptive programming setting a value in a WebEdit table.
#1
Solved: 10 Years, 9 Months, 1 Week ago
First inquiry to a forum -- ever --> be kind...

I am trying to use descriptive programming to set a value inside of a table. I am using QTP 8.2 and our company is not planning on upgrading (insert groaning noise here). When I run QTP here is my error message:

Cannot identify the object "WebEdit" (of class WebEdit). Verify that this object's properties match an object currently displayed in your application.

Here is my code using "DP" which does not work.
Code:
Browser("name:=Field Activity").Page("title:=Field Activity").Frame("name:=FA_TYPE_CHAR").WebEdit("name:=FA_CHAR:0$CHAR_VAL").Set "FLOODCHK"


Here is the code when I recorded the action(this works well):
Code:
Browser("Field Activity").Page("Field Activity_2").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:0$CHAR_VAL").Set "FLOODCHK"




I even tried to further clarify by adding the WebTable to the path and this also did not work.
Code:
Browser("name:=Field Activity").Page("title:=Field Activity").Frame("name:=FA_TYPE_CHAR").WebTable("innertext:=Characteristic Type Sequence Characteristic Value Check Type").WebEdit("name:=FA_CHAR:0$CHAR_VAL").Set "FLOODCHK"


I have used the Object spy to identify other properties I can use within the WebEdit portion, but I can not make it work like:"html id:=FA_CHAR:0$CHAR_VAL"

Here is what the Object Spy has returned when click on the cell:
Class name WebEdit
abs_x 547
abs_y 445
class data dc-CHAR-NONE-16-0 forms
default value empty when first trying to populate the cell
disabled 0
height 19
html id FA_CHAR:0CHAR_VAL
html tag INPUT
innerhtml
innertext
kind single line
max length 16
name FA_CHAR:0CHAR_VAL
outerhtml <INPUT class =" > lot of words here....
outertext
readonly 0
rows 0
type text
value
visible True
width 112
width in characters 18
x 331
y 122

Also, can someone please include examples of successful 'DP' code that can obtain a value from a table or debugging commands I can use to find out what's going on? (just learned about the .highlight command yesterday...)

Thanks in advance Mark S.
Reply
#2
Solved: 10 Years, 9 Months, 1 Week ago
Check the properties of webedit using ObjectSpy and use unique properties in DP
Reply
#3
Solved: 10 Years, 9 Months, 1 Week ago
Hello Mark,

By going through your description, What I think is the name of the WebEdit changes every time you launch the application.

Are "FA_CHAR: and "CHAR_VAL" always part of the WebEdit name?

If so, then try the below code once,

Code:
Browser("name:=Field Activity").Page("title:=Field Activity").Frame("name:=FA_TYPE_CHAR").WebEdit("name:=FA_CHAR.*CHAR_VAL.*").Set "FLOODCHK"

If there are more than 1 objects matching the property, then include the index property.

And yes, you do not need to add the WebTable to the hierarchy

Let me know how it goes.
Reply
#4
Solved: 10 Years, 9 Months, 1 Week ago
Thank you for your reply.

I continued to add and use the entries of WebEdit("name:=FA_CHAR:0$CHAR_VAL","id:=FA_CHAR:0$CHAR_VAL") since this is unique to each webedit box. However it still do not work.
When using the Object Spy, --> index <-- was not an option. I even tried to use your suggestion of using wild cards (*) and still no luck.

I then used .WebEdit("abs_x:=477","abs_y:=459") and that defined my area that I want to use.

I then figured out that there are 18 units between boxes, so I will make a loop and spin thru each field.

Thanks for all of your help.
Mark S.[/b][/i]
Reply
#5
Solved: 10 Years, 9 Months, 1 Week ago
Hi,

WebEdit is in Table or not? If it is in WebTable, handling situation is different... If it is just on page, handling is different.

make sure about the parent object. Then, proceed.
Reply
#6
Solved: 10 Years, 9 Months, 1 Week ago
Thanks for continuing this string...

Being new to QTP, this is how I would describe the sitiuation (By the way, I am using QTP 8.2 --> Not sure if this makes a difference).

Using Object Spy, I see that 'WebEdit' is within the Browser, Page, Frame, and WebTable.
Also, I do not see "index" as a property within "WebEdit" or "WebTable" although I see the value of "FA_CHAR:0$CHAR_VAL" within the property of "html id" --> By seeing the "0$CHAR_VAL", I assumed this means it is a table.

If someone could post an example of how to pull values from a "WebTable" and place it into a spreadsheet vs. from a "Page" --> that would be awesome. Hopefully, then I can then see what the difference is.

I appreciate any help in this matter.
Mark S
Reply
#7
Solved: 10 Years, 9 Months, 1 Week ago Rolleyes 
Hmm....

I hope you're beginner... good, Object identification is same in 8.2 and upto 10.0... Object spy will show most of the object in WebTable. But, once you add that object object Repository it won't show you that object in WebTable, just it shows that the object under page.

Eg: www.google.com,
Spy on Search field... It will show it is under a table.
Add that Search field to OR, It won't show that table in OR. so, it doesn't required that table to identify that object.

Now, in your scenario... add object to OR first then check WebEdit's ParentObject.
Get me this info... I'll give you the code to identify object.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Descriptive PROGRAMMING sandeepm1989 0 2,011 01-21-2016, 11:46 AM
Last Post: sandeepm1989
  Setting value in a WinObject Ansh123 0 4,178 03-20-2014, 09:44 PM
Last Post: Ansh123
  Setting values in Tabstrip TonyBarker 0 1,755 01-25-2013, 03:32 PM
Last Post: TonyBarker
  Is this one instance where descriptive programming does not work? chong67 10 6,817 10-09-2012, 06:41 PM
Last Post: harishshenoy
  Descriptive Programming By giving the description in form of the string arguments sia sharma 6 4,865 09-12-2012, 08:57 PM
Last Post: freeboynil

Forum Jump:


Users browsing this thread: 2 Guest(s)