Monday, 5 August 2013

Reading plist file using ruby : useful for calabash IOS Automation

#!/usr/bin/ruby -w
# encoding: utf-8

require 'plist'


def read_plist(plist_file)
  result=Plist::parse_xml(plist_file)
  i=0
  result.each { |k, v|
    i=i+1
    puts k
    puts v
    puts
  }
end

read_plist("features/dump/test.plist")

 Sample plist file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Language</key>
    <string>Svenska</string>
    <key>Version</key>
    <integer>4</integer>
  </dict>
</plist>




very useful while readings strings for localisation (calabash)

3 comments:

  1. Best place to learn Appium Android IOS Automation Testing Training in Chennai
    Go for Appium training in chennai for real time mobile automation testing training with real time project support.
    UI Automation Tools with real time scenarios You can contact 8122241286 for Best APPIUM and selenium Training in Chennai

    ReplyDelete
  2. Best place to learn Appium Android IOS Automation Testing Training in Chennai
    Go for Appium training in chennai for real time mobile automation testing training with real time project support.
    UI Automation Tools with real time scenarios You can contact 8122241286 for Best APPIUM and selenium Training in Chennai

    ReplyDelete
  3. Well explained. Got to learn new things from your Blog on Appium.Appium training in chennai

    ReplyDelete