Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why there always showing the element was not present after ..... second ??? Any idea..? #2560

Answered by mdmintz
Leeegod asked this question in Q&A
Discussion options

with SB(uc=True) as sb:
openpage(sb)
try:
versify(sb)
except Exception:
openpage(sb)
# verify(sb)
sb.sleep(2)
sb.send_keys("#mat-input-0", username)
sb.send_keys("#mat-input-1", passoword)
sb.sleep(1.5)
sb.driver.uc_click('span:contains(" Sign In ")')
sb.sleep(25)
sb.driver.uc_click("#mat-checkbox-1-input")
sb.driver.uc_click("#mat-checkbox-2-input")
sb.scroll_to_top()
sb.sleep(15)
sb.driver.uc_click('button[class="mat-focus-indicator"] + span')

 this is the code where all work propers but the last button doesn't perform click its showing error can''t found element 
 
 
 the element of the button is:
 <button mat-raised-button="" class="mat-focus-indicator btn mat-btn-lg btn-brand-orange d-none d-lg-inline-block position-absolute top-n3 right-0 z-index-999 mat-raised-button mat-button-base">

Start New Booking

Error is:

Message:
Element {button[class="mat-focus-indicator"] + span} was not present after 7 seconds!

is there any issue or any think i'm not getting ???

You must be logged in to vote

If the selector that you’re looking for isn’t on the page, you’ll get an error message that the element is not present. The selector that you used isn’t correct. Learn how to properly construct CSS Selectors: https://flukeout.github.io/

Replies: 3 comments 1 reply

Comment options

If the selector that you’re looking for isn’t on the page, you’ll get an error message that the element is not present. The selector that you used isn’t correct. Learn how to properly construct CSS Selectors: https://flukeout.github.io/

You must be logged in to vote
1 reply
Comment options

For this

button mat-raised-button="" class="mat-focus-indicator btn mat-btn-lg btn-brand-orange d-none d-lg-inline-block position-absolute top-n3 right-0 z-index-999 mat-raised-button mat-button-base">
span class="mat-button-wrapper"> Start New Booking </span

</buttn

isn't this a correct way???
sb.driver.uc_click('button[class="mat-focus-indicator"] + span')

Answer selected by mdmintz
Comment options

go with xpath it would work perfectly
...
On Sun, Mar 17, 2024 at 3:33 AM Umar Javed ***@***.***> wrote: Hey @Leeegod <https://github.com/Leeegod> , I'm stuck in the same situation. Can't seem to click on start new booking button. I don't know why this query sb.driver.uc_click("button.mat-btn-lg") works on the first page but does not work on the second even though it is the same button with same class. — Reply to this email directly, view it on GitHub <#2560 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AS5RAISIFPERUGFGY6LQLVTYYS42LAVCNFSM6AAAAABEDVWRL2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DQMJUGY2DS> . You are receiving this because you were mentioned.Message ID: ***@***.*** com>
You must be logged in to vote
0 replies
Comment options

Similar concern.

sb.wait_for_selector('input[type="text"][aria-label="Your name"]')

Works fine. SB fails by calling...

sb.type('input[type="text"][aria-label="Your name"]', 'Method Man')

...right after it. input[type="text"][aria-label="Your name"] is a valid CSS selector from all indications that SB seems to struggle with.

This is when attempting to join a google meeting.

Cc @mdmintz

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /