TT#68016 selenium: more improvements to get_text_safe()

FirefoxExtensions.pm:
- exit function when path is not specified
- is now able to use css and other paths as well. defaults to xpath

Change-Id: I9c47e1ee9ec502c97af25099c09ef6d7a7f007eb
(cherry picked from commit 9e245aa636)
changes/19/35519/1
Nico Schedel 6 years ago
parent 58deed97f8
commit 4c8db2b91a

@ -163,9 +163,11 @@ sub wait_for_attribute {
}
sub get_text_safe {
my ($self, $path) = @_;
my ($self, $path, $type) = @_;
return unless $path;
$type //= "xpath";
try {
my $element = $self->find_element($path);
my $element = $self->find_element($path, $type);
return $element->get_text();
} catch {
return 'Element not found';

Loading…
Cancel
Save