From d45e64fa5c7b02d5215ebc2605c8fe7a0ebda983 Mon Sep 17 00:00:00 2001 From: Praying Mantis Date: Mon, 7 Aug 2023 14:48:59 +0530 Subject: [PATCH] fixed global element api to work with element properties as argument --- lib/api/_loaders/element-global.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/api/_loaders/element-global.js b/lib/api/_loaders/element-global.js index 6ae3b8f882..c0ab172c35 100644 --- a/lib/api/_loaders/element-global.js +++ b/lib/api/_loaders/element-global.js @@ -34,8 +34,7 @@ class ElementGlobal { static element({locator, testSuite, client, options}) { const instance = new ElementGlobal({testSuite, client, options}); - const byInstance=Locator.create(locator); - instance.setLocator(byInstance); + instance.setLocator(locator); return instance.exported(); } @@ -88,7 +87,9 @@ class ElementGlobal { return; } - this.element = await this.transport.driver.wait(until.elementLocated(locator), this.timeout, null, this.retryInterval); + const byLocator=Locator.create(locator); + + this.element = await this.transport.driver.wait(until.elementLocated(byLocator), this.timeout, null, this.retryInterval); } static isElementObject(element) {