question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wait for alert keyword fails at wait for promise

See original GitHub issue

With Browser 12.3.0, when verifying the step wait for ${promsie} fails with this error ‘str’ object has no attribute ‘name’

To Reproduce Steps to reproduce the behavior:

Test to check alert
    [Arguments]    ${locator}    ${action}    ${text}
    ${promise}    promise to    wait for alert    action=${action}    text=${text}
    click    ${locator}
    wait for    ${promise}    # this is where it fails with  'str' object has no attribute 'name' 

Expected behavior wait for alert should not fail

Screenshots Stack trace screenshot image

Desktop (please complete the following information):

  • OS: iOS (BigSur, intel core)
  • Browser: chrome
  • Version [e.g. 22]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
luchoagomeztcommented, May 3, 2022

Thank you, with the browser library 9 the action=ACCEPT worked fine only after updating to 12.3.0, the test started failing. can I use both lower case and upper case for accept when the code fix is released? Thanks once again.

It is a simple fix, as of now only action=accept works, but I will fix the line of code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Await keyword is not properly halting until the promise is ...
In your case data['option_activity'].map is not a promise. see this example: let sample_arr= Array.from({ length: 10}, ...
Read more >
Async and Await in JavaScript, the extension to a promise.
This keyword makes JavaScript wait until that promise settles and returns its result. Here is an example with a promise that resolves in...
Read more >
Error handling with promises - The Modern JavaScript Tutorial
Promise chains are great at error handling. When a promise rejects, the control jumps to the closest rejection handler.
Read more >
How To Use JavaScript Wait Function In Selenium WebDriver
The keyword await makes the function wait for a Promise. When you await a Promise, the function is paused in a non-blocking way...
Read more >
Using .then(), .catch(), .finally() to Handle Errors in Javascript ...
Interestingly, you can make a new error either using the keyword “new” or omit it and ... 'pending', which is when it's still...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found