Hi Anna, Is there any method by which I can convert the String values to Hash.
Thanks Vikas On Apr 1, 11:06 am, Anna Gabutero <a...@lavabit.com> wrote: > On Tue, Mar 31, 2009 at 09:07:29PM -0700, Vikas Tulashyam wrote: > > > Hi firends, > > Please help me. > > > Thanks > > Vikas > > > On Mar 31, 6:24 pm, Vikas Tulashyam <vtulash...@gmail.com> wrote: > > > Hi, > > > Actually, I am trying to read the sLocator value form a xml file and > > > thats the main problem if I put the value directly into a variable > > > then it's working fine like--> > > > > a= {:name=>'q'} > > > return $sBrowser.text_field(a) > > > > Code written above works fine but when I m doing this- > > > > sLoc = getObjectLocator("Text_Search") > > > return $sBrowser.text_field(sLoc) > > > > def getObjectLocator(sObjectId) > > > begin > > > $sObjectFile = Document.new File.new("c:\\a.xml") > > > > $sObjectFile.elements.each("//TestObject[Identifier='# > > > {sObjectId}']") { |element| > > > sLocator = element.elements['Locator'].text > > > sObjectType = element.elements['ObjType'].text > > > return sLocator > > > } > > > > sLoc returns the correct value, I tried this by printing the sLoc > > > value but It is nt working > > It is returning a different value. Your assignment is equivalent to: > > sLoc = "{:name=>'q'}" > > which is different from: > > a = {:name=>'q'} > > The first is a string, the second is a hash, and these object types are > not interchangeable. > > - Anna --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---