select the item from the weblist

924 views
Skip to first unread message

Gajendra Jain

unread,
Oct 4, 2012, 6:55:40 AM10/4/12
to Mercu...@googlegroups.com
Hi,

I have a string in the weblist "test (16023)".

Problem is the number (16023) changes frequently.

Is there any way, where i just pass the text "test" or with some regular expression and make "test (16023)" selected?

Regards,
Gajendra

Vikas Thange

unread,
Oct 4, 2012, 7:31:24 AM10/4/12
to mercu...@googlegroups.com
Hi Gajendra,

Yes you can use the regurlar expression as "test \(\d{5}\)"

Revert for any concern.
Vikas.


--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Gajendra Jain

unread,
Oct 4, 2012, 7:42:11 AM10/4/12
to mercu...@googlegroups.com
Hi,

I tried that same.

Browser().Page().Weblist().Select "test \(\d{5}\)"

 it throws the following error
"Cannot identify the specified item Confirm that the specified item is included in the object's item collection."

Regards,
Gajendra

Vikas Thange

unread,
Oct 4, 2012, 8:58:36 AM10/4/12
to mercu...@googlegroups.com
Hi Gajendra,
add the given string in the object repository for identifying the object - (if u r using OR programming)
If you are using Dsecriptive programming then u have to give it programatically.

lokesh vinu

unread,
Oct 4, 2012, 10:53:14 AM10/4/12
to mercu...@googlegroups.com
try using test.*
- -
Thanks & Regards 
Lokesh K

avinash vl

unread,
Oct 4, 2012, 11:02:27 AM10/4/12
to mercu...@googlegroups.com

try with index
get all items in an array. and iterate through the array.
if(instr ("test(.*") > 0)
select particular item .
hope this help

Parke

unread,
Oct 4, 2012, 1:22:15 PM10/4/12
to QTP - HP Quick Test Professional - Automated Software Testing
Gajendra:

If the item is as you wrote, "*test *(16023)", then part of the
problem is the "*". It has a special meaning in regular expressions.
You will need to insert a backslash before the star, *, so that it is
taken as literal and not in its special reg ex meaning. The url,
http://www.mikesdotnetting.com/Article/44/VBScript-Regular-Expressions-Cheat-Sheet
, has a nice listing of metacharacters as do many other sites.

I expect you will need something very close to what Vikas wrote,
\*test \*\(\d{5}\) or perhaps something simple like "\*test .*"
without the quotes.

hth,

Parke

On Oct 4, 7:21 am, Gajendra Jain <jain.gajen...@gmail.com> wrote:
> Hi,
>
> I have a string in the weblist "*test *(16023)".
>
> Problem is the number (16023) changes frequently.
>
> Is there any way, where i just pass the text "*test*" or with some regular

Gajendra Jain

unread,
Oct 5, 2012, 1:17:49 AM10/5/12
to mercu...@googlegroups.com
I have added the weblist to the OR and trying to select the item from the list. The list contain the value in the form of  some "text and ( number )".

My doubt is, Can we select the item using regular expression. When we give

B().P().Weblist().select "test .*"

Does qtp understand the value "test .*" as a string only or string with Regular expression.



Regards,
Gajendra

Vikas Thange

unread,
Oct 5, 2012, 6:04:55 AM10/5/12
to mercu...@googlegroups.com
Hi Gajendra,
How many items are present in the weblist? only one or more than one?
or send me the snapshot of the page . i will give you the working code to select the item from list.

Rasim Avci

unread,
Oct 8, 2012, 2:23:37 AM10/8/12
to mercu...@googlegroups.com
* means any character (including special characters)

so in your case .* shoul be enough. Is it not working ?

2012/10/5, Vikas Thange <vikas...@gmail.com>:
Rasim Avcı

mahesh kumar

unread,
Oct 20, 2013, 4:09:19 AM10/20/13
to mercu...@googlegroups.com, Mercu...@googlegroups.com

On Thursday, 4 October 2012 04:21:33 UTC-7, gajendra wrote:
Hi,
Weblist option are 1)IEF pool 100032 mshe 2) "IoF pool 100035 mzor" 3)"IzF pool 100056 dore"
 
I have a string in the weblist "IEF pool 100032 mshe".

Problem is the that I need to select weblist item by giving only number 100032 using regular expression .

Regards,
mahesh
 

Wayne Hirata

unread,
Oct 21, 2013, 1:15:25 AM10/21/13
to mercu...@googlegroups.com, Mercu...@googlegroups.com
If regex does not work, try this:

a = Split(Browser().Page().WebList().GetROProperty("all items"), ";")
For i = 0 To UBound(a)
  If (a(i) = "test (16023)" Then
    Browser().Page().WebList().Select "#" & i
    Exit For
  End If
Next

Akhalesh Yadav

unread,
Oct 21, 2013, 3:52:53 AM10/21/13
to mercu...@googlegroups.com
Hi Gajendra,
                  I think this is not your complete question? let me know about the web list behavior or it have multiple items start with test(.....) items or has only one item? you can attach the snapshot of that web list that's why QTP group guys can give their valuable answers to you .


Thanks....
Akhalesh



--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Akhalesh yadav
+919555717928
+919310680659
Reply all
Reply to author
Forward
0 new messages