Add new By locator extras and wait conditions #210
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes have been made to incorporate new By locator features as well as additional wait condition functionality.
For By locators, these include:
ByAllthat can be used in place of aBylocator to locate elements that match all of the providedBylocators. This is useful when you want to find an element that matches multiple criteria, such as a button that has a specific text.RemoteWebElement element = app.FindElement(new ByAll(By.TagName("button"), ByExtras.Text("Send Message")));ByNestedthat can be used in place of aBylocator to locate elements that are nested by a sequence of locators. This is useful when you want to find an element that is nested within other elements, such as a button that is inside a form, inside an ID'd element.RemoteWebElement element = app.FindElement(new ByNested(By.Id("PersonContainer"), By.TagName("form"), By.TagName("button")));New wait conditions include:
ElementIsVisibleto wait for an element to be visible with a specific locator at the driverElementIsVisibleInElementto wait for an element to be visible with a specific locator within another elementElementIsVisibleInElementWrapperto wait for an element to be visible with a specific locator within an element wrapperElementIsVisibleInPageto wait for an element to be visible with a specific locator within a page objectElementIsNotVisibleto wait for an element to be hidden (not visible) with a specific locator at the driverElementIsNotVisibleInElementto wait for an element to be hidden (not visible) with a specific locator within another elementElementIsNotVisibleInElementWrapperto wait for an element to be hidden (not visible) with a specific locator within an element wrapperElementIsNotVisibleInPageto wait for an element to be hidden (not visible) with a specific locator within a page objectFrameAvailableToSwitchToto wait for a frame within the driver to be available and then switching the driver context to that frameAll
WaitUntilmethods within the platform have been updated to incorporate a retry mechanism, as well as supporting wait conditions that return values other than Booleans. These methods have also been update to return the result of the condition also.PR checklist
Other information