Skip to content

Commit 7aa9a5b

Browse files
author
Álvaro Santos Laserna López
committed
fix null pointer
1 parent 66b1882 commit 7aa9a5b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/testUI/Utils/By.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
import testUI.Configuration;
55

66
import static testUI.TestUIDriver.getDriver;
7+
import static testUI.TestUIDriver.getDrivers;
78

89
public class By {
910

1011
public static org.openqa.selenium.By byText(String text) {
1112
if (!Configuration.automationType.equals(Configuration.DESKTOP_PLATFORM))
12-
if (!getDriver().isBrowser())
13+
if (getDrivers().size() != 0 && !getDriver().isBrowser())
1314
return org.openqa.selenium.By.xpath("//*[contains(@text,'" + text + "')]");
1415
return Selectors.byText(text);
1516
}

0 commit comments

Comments
 (0)