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
changes/25/34825/1
Nico Schedel 6 years ago
parent 11eeb92b49
commit 9e245aa636

@ -126,9 +126,11 @@ sub move_and_click {
}
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