title: Why is appium throwing error when desired capability is using variable
body: <p>I am trying to write a test automation to log test result post completion &amp; i need to log the device name and result post completion.</p>
  
  <p>Everything seems to work expect when  i set the desired capabilities device name value as a variable it fails.</p>
  
  <pre><code>let desiredCaps = {
          platformName: 'Android',
          platformVersion: '9',
          deviceName: Name,
          app: Apk,
          fullReset: false,
          automationName: "UiAutomator2"
      };
  </code></pre>
  
  <p>I  have tested by changing the value to a static value:</p>
  
  <pre><code>let desiredCaps = {
          platformName: 'Android',
          platformVersion: '9',
          deviceName: 'testDevice1',
          app: Apk,
          fullReset: false,
          automationName: 'UiAutomator2'
      };
  </code></pre>
  
  <p>It works just fine without any issues.</p>
  
  <pre><code>const Set_Desired_Device_Capabilities = async function Set_Desired_Device_Capabilities(Port, Name, Apk) {
      let driver = await wd.promiseChainRemote({
          host: '127.0.0.1',
          port: Port
      });
      let desiredCaps = {
          platformName: 'Android',
          platformVersion: '9',
          deviceName: Name,
          app: Apk,
          fullReset: false,
          automationName: 'UiAutomator2'
      };
  
      console.log(desiredCaps);
      await driver.init(desiredCaps);
      await driver.setImplicitWaitTimeout(30000);
  
  };
  
  
  module.exports = Set_Desired_Device_Capabilities;
  </code></pre>
  
  <p>With the above code i end up getting this error:</p>
  
  <pre><code>init(
       {
         "platformName":"Android",
         "platformVersion":"9",
         "deviceName":"testDevice1",
         "app":"/Users/username/Downloads/test.apk",
         "fullReset":false,
         "automationName":"UiAutomator2"
       }
    )
  ] Parse Error
  </code></pre>
  
  <p>Is there a workaround for this or a better way to pass the device name as variable ?</p>