applitools / Eyes.Selenium.JavaScript

Applitools Eyes SDK For Selenium JavaScript WebDriver
Other
18 stars 18 forks source link

Fix return type of overridden findElement method #41

Closed astappiev closed 7 years ago

mekdev commented 7 years ago

Does this fix the problem of using overridden driver object ?

We started getting the below error

2017-08-16T00:56:59.203Z - Element: By(css selector, .table-column-name) not visible with error: WebElementCondition did not resolve to a WebElement: [object Object]

On tracing down to the selenium code I see that its erroring out at webdriver.js line 955

    if (condition instanceof WebElementCondition) {
      result = new WebElementPromise(this, result.then(function(value) {
        console.log(value)
        if (!(value instanceof WebElement)) {
          throw TypeError(
              'WebElementCondition did not resolve to a WebElement: '
                  + Object.prototype.toString.call(value));
        }
        return value;
      }));
    }
    return result;
  }

When I printed out the value it is EyesRemoteWebElement but selenium 3+ is expecting WebElement

mekdev commented 7 years ago

So downgrading to 0.0.50 fixed it for us

astappiev commented 7 years ago

No, it doesn't fix the problem. There was a problem that after calling to driver.findElement method it returns a promise which did not have WebElement's methods like click, sendKeys and so. The PR revert some changes since version 0.0.68.

Can you help me to reproduce the problem that you mention? A name of the method in your test which causes the error will be helpful.