node.jswinappdriver

Winappdriver findElement - NodeJS


am learning winappdriver and I try to run the below example.

  let driver = new WindowsDriver();
  await driver.createSession(defaultCaps);
  let element = await driver.findElement('//*[@ClassName="Edit"]');

but no matter how I use findElement, I always get the below error

nfo WD Proxy Determined the downstream protocol as 'MJSONWP' dbug BaseDriver Valid locator strategies for this request: xpath, id, name, class name, accessibility id

Should I initiate the driver differently. Can anybody point me on how to use findElement with winappdriver in javascript

Any help is appreciated


Solution

  • just include the strategy 'xpath':

      let driver = new WindowsDriver();
      await driver.createSession(defaultCaps);
      let element = await driver.findElement('xpath', '//*[@ClassName="Edit"]');