$.getWrappedElement() should not wait for timeout if element does not exist
See original GitHub issuethe subj method is implemented based on the command:
public class ToWebElement implements Command<WebElement> {
@Override
public WebElement execute(SelenideElement proxy, WebElementSource locator, Object[] args) {
return locator.getWebElement();
}
}
this command will fail if element does not exist… and will be retried inside “the only one logic of SelenideElementProxy invocation of all commands”:
class SelenideElementProxy implements InvocationHandler {
//...
@Override
public Object invoke(Object proxy, Method method, Object... args) throws Throwable {
if (methodsToSkipLogging.contains(method.getName()))
return Commands.getInstance().execute(proxy, webElementSource, method.getName(), args);
validateAssertionMode(config());
long timeoutMs = getTimeoutMs(method, args);
long pollingIntervalMs = getPollingIntervalMs(method, args);
SelenideLog log = SelenideLogger.beginStep(webElementSource.getSearchCriteria(), method.getName(), args);
try {
Object result = dispatchAndRetry(timeoutMs, pollingIntervalMs, proxy, method, args);
SelenideLogger.commitStep(log, PASS);
return result;
}
catch (Error error) {
Error wrappedError = UIAssertionError.wrap(driver(), error, timeoutMs);
SelenideLogger.commitStep(log, wrappedError);
if (config().assertionMode() == SOFT && methodsForSoftAssertion.contains(method.getName()))
return proxy;
else
throw wrappedError;
}
catch (RuntimeException error) {
SelenideLogger.commitStep(log, error);
throw error;
}
}
// ...
}
but it should not… We should have a raw interface to original Selenium WebDriver WebElement without any waiting logic…
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
java - how to continue the flow when an element is not exists ...
Here you can pass the element locator and the timeout to wait for that element presence. If normally we use 20-30 seconds timeout...
Read more >SelenideElement (selenide 5.20.4 API) - javadoc.io
IMPORTANT: If element does match the conditions, waits up to 4 seconds until element does not meet the conditions. It's extremely useful for...
Read more >codeborne/selenide - Gitter
Guys, i try to click on one element but selenide doesn't see it....as soon as i use getWrappedElement() it start clicking? what can...
Read more >UiElement (WorkFusion API 10.0.0.16) - AWS
Get parent element of this element For example, $("td").parent() could give some "tr". ... Checks that given element does not meet given conditions....
Read more >Interface SelenideElement
exists(). Checks if element exists true on the current page. SelenideElement ... Wait until given element does NOT meet given condition (with given...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suggest that both methods should NOT wait. They are rather synonyms. Otherwise it’s too hard to keep the difference in mind.
I don’t see any reasons why someone would need the “waiting” here.
Done in https://github.com/selenide/selenide/pull/1124