I am trying to use regular expression in variable declaration with in a function.
Above is my script. I have to define innertext value using input parameter label and regular expression.
When it is executed, i am getting the innertext value as ".*label.*"
Code:
Function FieldExistOrNot(label)
Dim flag
Dim objDescription
Set objDescription = Description.Create()
objDescription("ClassName").Value = "WebElement"
objDescription("innertext").RegularExpression = True
objDescription("html tag").value ="LABEL"
objDescription("innertext").value = ".*" &label& ".*"
MsgBox objDescription("innertext").value
flag = Browser("Name:=Home Page for.*").page("Title:=Home Page for.*").Frame("title:=Content Check-In.*").WebTable("Text:=Content Check-In.*").WebElement(objDescription).exist
End Function
When it is executed, i am getting the innertext value as ".*label.*"