-   Notifications  
You must be signed in to change notification settings  - Fork 35
 
Adding retry policy #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…, added verification of wait time
changed IElementStateProvider interface: added methods for waitings with default condition timeouts excluded ability to call state methods directly from elements, now users have to use state() method
refactored elements' states added isClickable
…ity-selenium-java # Conflicts: # src/main/java/aquality/selenium/elements/DesiredState.java # src/main/java/aquality/selenium/elements/Element.java # src/main/java/aquality/selenium/elements/ElementFinder.java # src/main/java/aquality/selenium/elements/ElementStateProvider.java # src/main/java/aquality/selenium/elements/interfaces/IElement.java # src/main/java/aquality/selenium/waitings/ConditionalWait.java # src/test/java/tests/integration/ElementStateTests.java # src/test/java/tests/usecases/ElementExistNotDisplayedTest.java
conditional wait moved under tests/ because of many places where it is used
conditional wait moved under tests/ because of many places where it is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please throw exception when failed to select option by contain in ComboBox.
 Also don't catch in the TextBox submit method
…g exception if it was failed attempt to select removed catching of WebDriverException in TextBox
|   @mialeska changed according to your comments  |  
| } | ||
| return false; | ||
| if (!isSelected){ | ||
| throw new StaleElementReferenceException(String.format(getLocManager().getValue("loc.combobox.impossible.to.select.contain.value.or.text"), value, getName())); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ain't a real staleElementReference, why should we do retry in this case? let's throw unhandled exception, like we do it in dotnet solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced
| getElement().clear(); | ||
| getElement().sendKeys(value); | ||
| return true; | ||
| } catch (WebDriverException e) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not catch here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| try { | ||
| getElement().sendKeys(value); | ||
| return true; | ||
| } catch (WebDriverException e) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should not catch here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| infoLoc("loc.clicking"); | ||
| new JsActions(element, type, name).highlightElement(); | ||
| ConditionalWait.waitFor(driver -> performAction(new Actions(driver).click(element.getElement()))); | ||
| ElementActionRetrier.doWithRetry(() -> performAction(new Actions(getBrowser().getDriver()).click(element.getElement()))); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that it does make sense to make a private method with common logic (please see the dotnet implementation for more details)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
| } | ||
| return false; | ||
| if (!isSelected){ | ||
| throw new StaleElementReferenceException(String.format(getLocManager().getValue("loc.combobox.impossible.to.select.contain.value.or.text"), value, getName())); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual question
| getLogger().debug(e.getMessage()); | ||
| return false; | ||
| } | ||
| ElementActionRetrier.doWithRetry(() -> { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need curly braces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| try { | ||
| getElement().sendKeys(value); | ||
| return true; | ||
| } catch (WebDriverException e) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
| getElement().clear(); | ||
| getElement().sendKeys(value); | ||
| return true; | ||
| } catch (WebDriverException e) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
| @@ -1,4 +1,4 @@ | |||
| package aquality.selenium.waitings; | |||
| package utils; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, no longer than today morning I thought we had decided to remove ConditionalWait with its end :) But times are changing
I will get back ConditionalWait in separate PR
| infoLoc("loc.clicking"); | ||
| new JsActions(element, type, name).highlightElement(); | ||
| ConditionalWait.waitFor(driver -> performAction(new Actions(driver).click(element.getElement()))); | ||
| ElementActionRetrier.doWithRetry(() -> performAction(new Actions(getBrowser().getDriver()).click(element.getElement()))); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still actual
| * Click Right (call context menu) on the element | ||
| */ | ||
| public void rightClick() { | ||
| public void clickRight() { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it should be named rightClick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted this change
No description provided.