Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How uniqule Identify WebEdit in QTP
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I have an application where 6, 7 edit fields. User can add or delete edit field as well. I want to populate one Edit field against label "ABC".

on normal recording it looks like this:
Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:1$CHAR_VAL").Click
but if this field (1) at number 2, QTP will popluate this value in wrong field.

How to identify uniquely this field.

Regards,
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Use index property ...

(01-24-2013, 02:19 PM)QTP9.2 Wrote: I have an application where 6, 7 edit fields. User can add or delete edit field as well. I want to populate one Edit field against label "ABC".

on normal recording it looks like this:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:1$CHAR_VAL").Click

but if this field (1) at number 2, QTP will popluate this value in wrong field.

How to identify uniquely this field.

Regards,
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Can you write one liner syntax ... as given in example.

Secondly, index will not be change when order of the field change ?

if one write this

Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:1$CHAR_VAL").Click
like this

Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:"&RowNum&"$CHAR_VAL").Click

what does this means
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
In the above line of code: 'RowNum' has been parameterized or regular expression been used.
i.e u can add the value to the 'RowNum' at the run time like below , it will work for all the values..

Code:
RowNum = 1
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:"&RowNum&"$CHAR_VAL").Click

this is same as :
Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:1$CHAR_VAL").Click


Ex2:

Code:
RowNum = 2
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:"&RowNum&"$CHAR_VAL").Click

this is same as :
Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("FA_CHAR:2$CHAR_VAL").Click

other question about INDEX:
Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("index:=0").set "your value"
this will set 'your value' into the first text box.
Code:
Browser("User").Page("Field Activity").Frame("FA_TYPE_CHAR").WebEdit("index:=1").set "your value"
this is for second text box
Note: indexing starts from 0

Regards,
Harish
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how resolve "webedit" cannot identify jabap4 3 4,626 04-23-2015, 08:22 PM
Last Post: babu123
  How to differentiate two webEdit in same page like user name and password in qtp jegansurya 1 2,893 07-26-2012, 11:29 AM
Last Post: K Gaurav Varshney
  qtp not identifying webedit object apeksha_sonu 1 3,188 02-15-2012, 05:43 PM
Last Post: basanth27
  Enable WebEdit in QTP bebeo 9 16,680 09-14-2009, 07:33 AM
Last Post: bebeo

Forum Jump:


Users browsing this thread: 1 Guest(s)