Dmitri1
(Dmitri Pisarenko)
February 18, 2011, 10:22am
1
Hello!
I have a test scenario, in which
a) the user enters a wrong value,
b) presses a button and
c) an error message (
notification
) appears.
I want to automate this test, including checking that the error message actually appears.
Is there any way to do it with plain Selenium?
When I right-click the notification (to select some check from the context menu), it disappears.
Thanks in advance
Dmitri
Dmitri
(Dmitri Livotov)
February 18, 2011, 12:10pm
2
Hi Dmitri,
what if you change the type of notification to ERROR - AFAIR, it closes only when clicking to “X” icon not to entire notification area.
Dmitri1
(Dmitri Pisarenko)
February 18, 2011, 12:45pm
3
Hello!
Unfortunately, it doesn’t work that way - if I right-click the notification (with Notification.TYPE_ERROR_MESSAGE type) the window disappears.
At least on Windows 7 under Firefox 3.6.13.
Best regards
Dmitri
Dmitri1
(Dmitri Pisarenko)
February 18, 2011, 4:36pm
4
Hello!
I have another question - does
Vaadin TestBench
support testing notifications?
Thanks in advance
Dmitri
Jonatan
(Jonatan Kronqvist)
February 22, 2011, 10:55am
5
Hi Dmitri,
Vaadin TestBench does support recording of any notifications and asserting text in error type notifications.
You will have to add text asserts by hand in the TestBench (Selenium) IDE, and select the notification element containing the text you want to assert. After this you will need to move the assert to before the recorded closeNotification event. Other than that inconvenience, it should work as expected.
HTH,
/Jonatan
Alexey15
(Alexey Skor)
February 7, 2013, 11:34pm
6
is there a way to test Vaadin notifications in regular unit tests?
Anjali
(Anjali Jain)
December 30, 2015, 9:42am
7
Hey,
Is there any way to handle notification using Testbench(selenium)webdriver code.
Artur
(Artur Signell)
December 30, 2015, 11:15am
8
Using TestBench 4 you can find and interact with notifications like any other component, e.g.
NotificationElement notification = $(NotificationElement.class).first();
Assert.assertEquals("Hello world", notification.getDescription());
notification.close();