Zarkonnen / se-interpreter

Interpreter for Selenium Builder JSON scripts based on node.js and wd.
34 stars 31 forks source link

No ${placeholder} replacement for xpath locator type #24

Closed davidlinse closed 10 years ago

davidlinse commented 10 years ago

Hi.. I'm facing an issue where ${varname} is not replaced with the value from configs.manual..

The following script to reproduce runs fine in SE-Builder (latest HEAD) but fails in SE-Interpreter (1.0.6) running against v2.41.0 of selenium-standalone-server

{
  "type": "script",
  "seleniumVersion": "2",
  "formatVersion": 2,
  "steps": [
    {
      "name": "Open se-builder homepage page",
      "type": "get",
      "url": "${se-builder-homepage}"
    },

    {
      "name": "Should find headline via inline xpath",
      "type": "assertElementPresent",
      "locator": {
        "type": "xpath",
        "value": "//h1[@class='selenium-builder-logo']"
      }
    },
    {
      "name": "Should find headline via xpath variable",
      "type": "assertElementPresent",
      "locator": {
        "type": "xpath",
        "value": "${headline-xpath}"
      }
    }
  ],
  "data": {
    "configs": {
      "none": {},
      "manual": {
        "se-builder-homepage":  "http://sebuilder.github.io/se-builder/",
        "headline-xpath":       "//h1[@class='selenium-builder-logo']"
      }
    },
    "source": "manual"
  },
  "inputs": [],
  "timeoutSeconds": 30
}

Would you mind looking into this ?

Update: You can see the selenium-server log in this gist

kind regards ~david

Zarkonnen commented 10 years ago

Looking into repro now.

Zarkonnen commented 10 years ago

Yep, can repro:

SE-Interpreter 1.0.6
ex: Starting test (firefox) ex
ex: Success {"name":"Open se-builder homepage page","type":"get","url":"${se-builder-homepage}"}
ex: Success {"name":"Should find headline via inline xpath","type":"assertElementPresent","locator":{"type":"xpath","value":"//h1[@class='selenium-builder-logo']"}}
ex: Failed [Error: ElementPresent is false]
ex: Test failed: [Error: ElementPresent is false]
0/1 tests ran successfully. Exiting

Looks like interpreter is just failing to sub inside locators!