check toast message

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

check toast message

Fabio Rafaelli
Hi all
How can i be sure that this element (Toast message) appear on the screen and get the message within it?
Best regards
Fabio

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/41e1eae6-bc6a-405e-9fa2-ae6524e105a5o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: check toast message

Fabio Rafaelli
The element is :

<span class="toastMessage slds-text-heading--small forceActionsText" data-aura-rendered-by="3183:0" data-aura-class="forceActionsText">Opportunity <!--render facet: 3191:0--><a href="javascript:void(0)" title="aaa" data-aura-rendered-by="3206:0" class="forceActionLink" data-aura-class="forceActionLink"><div title="aaa" data-aura-rendered-by="3207:0">aaa</div></a> was created.</span>


Il giorno giovedì 2 luglio 2020 10:01:17 UTC+2, Fabio Rafaelli ha scritto:
Hi all
How can i be sure that this element (Toast message) appear on the screen and get the message within it?
Best regards
Fabio

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/679a3dd2-84cb-43a3-8275-06c7ec60c147o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: check toast message

Devotional Videos
You can try to driver.getPageSource() just at the time when the toast message appears and check if the returned page source contains toast message text.
  There might be better ways to do it. May be the experts in the group can share more inputs.

On Thu, Jul 2, 2020 at 10:04 AM Fabio Rafaelli <[hidden email]> wrote:
The element is :

<span class="toastMessage slds-text-heading--small forceActionsText" data-aura-rendered-by="3183:0" data-aura-class="forceActionsText">Opportunity <!--render facet: 3191:0--><a href="javascript:void(0)" title="aaa" data-aura-rendered-by="3206:0" class="forceActionLink" data-aura-class="forceActionLink"><div title="aaa" data-aura-rendered-by="3207:0">aaa</div></a> was created.</span>


Il giorno giovedì 2 luglio 2020 10:01:17 UTC+2, Fabio Rafaelli ha scritto:
Hi all
How can i be sure that this element (Toast message) appear on the screen and get the message within it?
Best regards
Fabio

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/679a3dd2-84cb-43a3-8275-06c7ec60c147o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAN%3DmKSEYCn4jecNgmySv9o0idBVjab4y1b0b_0a9JvkRtJ8%2Bhw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: check toast message

Gabriel Tardif
In reply to this post by Fabio Rafaelli
element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, "toastMessage slds-text-heading--small forceActionsText"))

If the language you are using is python I will suggest something like above.
Or you can check this website https://selenium-python.readthedocs.io/waits.html
Or this one for accurate documentation https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.expected_conditions.html?highlight=expected

On Thursday, 2 July 2020 01:01:17 UTC-7, Fabio Rafaelli wrote:
Hi all
How can i be sure that this element (Toast message) appear on the screen and get the message within it?
Best regards
Fabio

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/11385687-d654-4a45-9ad3-660c8922736eo%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: check toast message

Hanumantha Reddy
In reply to this post by Fabio Rafaelli


On Thursday, 2 July 2020 13:31:17 UTC+5:30, Fabio Rafaelli wrote:
Hi all
How can i be sure that this element (Toast message) appear on the screen and get the message within it?
Best regards
Fabio

You can wait for the element visible. This can be achieved by used WebDriverWait object. You can follow below code,

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(12));
            wait.Until(ExpectedConditions.ElementExists(By.ClassName("forceActionLink")));

For more information on WebDriverWait and how to use, you can follow below video.


Disclaimer : I support the channel of the video link I shared  

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/75ca8d2c-25bc-4a86-a6be-485cd8272f9ao%40googlegroups.com.