Is it possible to write 'Desired capabilities' into config file?

Hi,
I am exploring appium since last week.And I would like to know that how can I set capabilities in config file and how can I set up config file in my script. Currently,I am described all the capabilities into my script ( in before class) .But I want to write all capabilities into config file and featch value from config.

If anyone share your inputs.please share reference link as well.

Thanks,
Gunjan.

We’ve created a YAML file which we read into a hash when we start up our test process. We pass the config values as desired capabilities to Appium.

Thanks willosser for quick reply. It would be great if you can share some examples or reference link because I have no idea about YAML file.

One more I am using eclipes.so,does eclipes support YAML file?

YAML is Yet Another Markup Language. You can find details here:

http://yaml.org/

You can use any markup language or your own format.

As an example, we have a file called config.yml that contain’s lines like this:

app_package: com/package
app_activity: .activity

In our test harness, we load the config file and read it into a hash. Note that we’ve already determined the project dir earlier.

settings = yaml_load(File.join(project_dir, copnfig.yml))

Then we convert the config file names to the format needed for appium capability

capabilities.merge {appPackage: settings.app_package, 
                             appActivity: settings.app_activity}

This is Ruby, but I’m certain you can adapt to whatever language you are using.