nightwatch icon indicating copy to clipboard operation
nightwatch copied to clipboard

global element api not working with element properties as argument

Open garg3133 opened this issue 2 years ago • 3 comments

Description of the bug/issue

When ElementProperties is passed to global element() API as an argument, the command fails with the following error:

image

This is happening because of this line: https://github.com/nightwatchjs/nightwatch/blob/4b09cb57c8a9fb29d6b6795e59c64b4942bddf67/lib/api/_loaders/element-global.js#L90

Here, instead of a By instance, an Element instance is getting passed as locator.

Steps to reproduce

No response

Sample test

browser.navigateTo('https://www.bstackdemo.com/')

const elem = element({selector: '.shelf-item', index: 24});

await elem.getId();

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

v3 beta1

Node Version

No response

Browser

No response

Operating System

No response

Additional Information

No response

garg3133 avatar Jun 14 '23 16:06 garg3133

I want to work on this issue.

yashPratp983 avatar Jul 25 '23 16:07 yashPratp983

Can i take this forward @garg3133

Gmin2 avatar Feb 24 '24 09:02 Gmin2

I think this issue should be closed ref: https://github.com/nightwatchjs/nightwatch/pull/3835#issuecomment-1812013588

dikwickley avatar Mar 15 '24 07:03 dikwickley