Skip to content
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

Revisit Get-SeElement wait condition. #197

Open
itfranck opened this issue Dec 6, 2020 · 1 comment
Open

Revisit Get-SeElement wait condition. #197

itfranck opened this issue Dec 6, 2020 · 1 comment
Assignees

Comments

@itfranck
Copy link
Collaborator

itfranck commented Dec 6, 2020

We used PresenceofAllElementLocatedBy when using a timeout, which might not wait long enough.

I think we should probably use ElementIsVisible (unlessAll switch is used, in which case ElementExists) and then potentially make a second call to get the actual elements.

Otherwise we end up needing to do :

Start-SeDriver -Browser Chrome -Position 1920x0 -StartURL 'https://login.live.com/login.srf' -ImplicitWait 10 # Implicit wait didn't change anything here
 Wait-SeElement -By TagName -Value input -Condition ElementIsVisible -Timeout 10
$EmailField =  Get-SeInput -Type email -Timeout 3
$EmailField | Invoke-SeKeys -Keys 'itfranck@example.com'

I think the Wait-SeElement part should not be required everywhere and intrinsic to the process.
Ultimately, using this module should be as smooth as using the browser.

@itfranck itfranck added this to the v4.0.0-preview3 milestone Dec 6, 2020
@itfranck itfranck self-assigned this Dec 6, 2020
itfranck added a commit that referenced this issue Dec 8, 2020
Since Start-SeDriver have priority over options, options should not handle stuff that depends on parameters.
@itfranck itfranck removed this from the v4.0.0-preview3 milestone Mar 7, 2021
@franklin050187
Copy link

franklin050187 commented Apr 26, 2021

Hello,

I would like to +1 this request :
adding a -visible switch and -clickable switch would greatly help smoothness of test instead of using what @itfranck is doing or what I do (add start-sleep -seconds 1 because I know every action on a specific website has a fading frame of .8 sec after every click)

from https://www.selenium.dev/documentation/fr/webdriver/waits/
new WebDriverWait(driver, TimeSpan.FromSeconds(3)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("//a/h3")));
maybe having a passthrough here could be a starting point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants