Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular expression in Select
#2
Solved: 10 Years, 9 Months, 4 Weeks ago
Hi Maverick,

Yup i will agree with you, that the select method won't work with regular expression but you can write function/method to select the listitem even with regurlar expression.

Please find the below LOC and open the Google page and then paste and run the code.
'------------------------------------------------------------------------------------
Code:
Browser("name:=Google").Page("title:=Google").Link("name:=Preferences").Click
'I want to select "Hungarian" from the list box.    
WLSelection Browser("name:=Preferences").Page("title:=Preferences").WebList("name:=hl"),"Hung.*"

Function WLSelection(strLBPath,strLBitem)
    Dim LBitem,allitems,itemsnum
    If instr(strLBitem,".*")>0 Then
        LBitem=Split(strLBitem,".*")
        allitems=strLBPath.GetROProperty("all items")
        allitems=split(allitems,";")
        For itemsnum=0 to ubound(allitems)-1
            If instr(allitems(itemsnum),LBitem(0))>0 Then
                strLBPath.Select itemsnum
                Exit for
            End If
        Next
    Else
        strLBPath.Select strLBitem
    End If
End Function
'----------------------------------------------------------------------------------------
Let me know if you need any more info.
Thanks,
SUpputuri
Reply


Messages In This Thread
Regular expression in Select - by Maverick - 07-13-2009, 04:53 PM
RE: Regular expression in Select - by supputuri - 07-16-2009, 05:29 PM
RE: Regular expression in Select - by Maverick - 07-18-2009, 09:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,282 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,223 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,638 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,424 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,039 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)