I am using Selenium 2 with Webdriver. I would like to pass in my desired environment as part of a set of test data. My code looks like this:
capability = webdriver.DesiredCapabilities.FIREFOX
And works correctly. But I would like to pass the "FIREFOX" in from a variable, kind of like this:
TestParameters['Environment']="FIREFOX"
capability = webdriver.DesiredCapabilities.TestParameters['Environment']
But I get this error
AttributeError: type object 'DesiredCapabilities' has no attribute 'TestParameters'
What can I do to evaluate the variable contents as a method name?