Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to know Regular Expression is True or False
#1
Hi There,

I am creating one tool to convert tsr file to XML file. I know in object repository manger export to xml option is available but I need customized XML which is different then QTP XML


I am able to get all the object and their property using existing object ObjectRepositoryUtil methods but not correct regular expression value from tsr.

If in TSR property value set true for regular expression and then using the following method it should retrieve the value correct value:

msgbox Property.RegularExpression
Output should be true for RE enable property value and false for not enable property values. But here I am finding discrepancy in this method. Value is displayed but not the correct one. Even if I enable true it shows false as an output

Please find the function which may be usefully for understanding


Code:
Function EnumerateAllChildProperties(Root) 'The following function enumerates all the test objects under a specified object. 'For each test object, a message box opens containing the test object's name, 'properties, and property values. Dim TOCollection, TestObject, PropertiesCollection, Property, Msg Dim tmpCollection Dim strObjNode Dim strPropNode Dim strObjType Dim vPValue,vOName Set TOCollection = RepositoryFrom.GetChildren(Root) For i = 0 To TOCollection.Count - 1 Set TestObject = TOCollection.Item(i) vOName = RepositoryFrom.GetLogicalName(TestObject) vOName = Check_Replace_XMLSpChars(vOName) strobjType = TestObject.GetTOProperty("micclass") strObjNode = "<Object Type = '" & strObjType & "' Name = '" & vOName & "'>" Set PropertiesCollection = TestObject.GetTOProperties() strPropNode="" For n = 0 To PropertiesCollection.Count - 1 Set Property = PropertiesCollection.Item(n) vPValue = Property.Value vPValue = Check_Replace_XMLSpChars(vPValue) [b][size=x-large]Msgbox Property.RegularExpression [/size] strPropNode = [/b]strPropNode & "<Property Name = '" & Property.Name & "' Value = '" & vPValue & "' />" & vbNewLine Next ts.WriteLine strObjNode ts.WriteLine strPropNode EnumerateAllChildProperties TestObject set tmpCollection = RepositoryFrom.GetChildren(TestObject) If tmpCollection.Count >0 Then ts.WriteLine "</Object>" Next If TOCollection.Count < 1 then ts.WriteLine "</Object>" End Function


Please let me know for any further information.

Other suggestions are welcome. Would like to know if there is any other way.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  regular expression in html sujaravi123 0 2,667 12-31-2013, 03:00 PM
Last Post: sujaravi123
  Disabled Webelement is showing up as Visible =True in GUI Spy Shwethareddy 3 4,650 11-07-2012, 02:45 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)