Skip to content

Commit 2ad21d6

Browse files
committed
fix retry logic
1 parent 8e84138 commit 2ad21d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webdriver-ts/src/webdriverAccess.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ export function testElementLocatedById(driver: WebDriver, id: string, timeout =
183183
async function retry<T>(retryCount: number, driver: WebDriver, fun : (driver: WebDriver, retryCount: number) => Promise<T>): Promise<T> {
184184
for (let i=0; i<retryCount; i++) {
185185
try {
186-
return fun(driver, i);
186+
return await fun(driver, i);
187187
} catch (err) {
188-
console.log("retry failed");
188+
console.log("comand failed. Retry #", i+1);
189189
}
190190
}
191191
}

0 commit comments

Comments
 (0)