TT#56376 selenium: add error labels to crash detection

crash detection will now check for error labels and will print them out
if possible

Change-Id: Ib583608a2b1f27ea32d079b17676acdfc5940b7c
changes/58/31058/3
Nico Schedel 6 years ago
parent 119c41eba9
commit 38d730ed07

@ -389,6 +389,16 @@ sub crash_handler {
diag("Tab Title: $title");
diag("nginx error: $crashvar");
diag("Perl localtime(): $realtime");
} elsif(eval{$self->driver->find_element('//*[@id="content"]//div[@class="alert alert-error"]')}) {
my $label = "Label: could not get text";
eval {
$label = $self->driver->find_element('//*[@id="content"]//div[@class="alert alert-error"]')->get_text();
};
diag("Server: $ENV{CATALYST_SERVER}");
diag("Url: $url");
diag("Tab Title: $title");
diag("Error Label: $label");
diag("Perl localtime(): $realtime");
} else {
diag("Could not detect Server issues. Maybe script problems?");
diag("If you still want to check server logs, here's some info");

Loading…
Cancel
Save