title: How to pass variable values to sendKeys in casperjs
body: <p>I have the following issue with sendKeys in casperjs.
  I am trying to pass the port as an option into casperjs and this is working, but when i try to use the port value with casper.cli.get it doesn't work in sendKeys!!!</p>
  
  <pre><code>var casper = require('casper').create();
  casper.echo("Casper CLI passed args:");
  require("utils").dump(casper.cli.args);
  
  casper.echo("Casper CLI passed options:");
  require("utils").dump(casper.cli.options);
  
  if (casper.cli.has("ip") === false) {
    casper.echo("Usage: casper.js test modify_port.js --ip=&lt;x.x.x.x&gt; --port=&lt;xxxxx&gt;").exit();
  }
  if (casper.cli.has("port") === false) {
    casper.echo("Usage: casper.js test modify_port.js --ip=&lt;x.x.x.x&gt; --port=&lt;xxxxx&gt;").exit();
  }
  ...
      casper.then(function() {
          test.assertTextExists("Change", "Data Base - Change - port");
          this.sendKeys('input[name="Params.port"]', casper.cli.get("port"));
          this.click('input[name="Apply"]');
      });
  </code></pre>
  
  <p>The above way seems not to work and it doesn't give me also no error msg.
  But when i hard code the port in the sendKeys line then i see that the port is changed, like:</p>
  
  <pre><code>this.sendKeys('input[name="Params.port"]', '29999');
  </code></pre>
  
  <p>This is also working fine (hard coded):</p>
  
  <pre><code>var myPort = '29999'
  this.sendKeys('input[name="Params.port"]', myPort);
  </code></pre>
  
  <p>But this again is not working:</p>
  
  <pre><code>var myPort = casper.cli.get("port")
  this.sendKeys('input[name="Params.port"]', myPort);
  </code></pre>
  
  <p>Thanks in adv. for your time</p>