Skip to content

Commit 4dd8798

Browse files
authored
Merge pull request #101 from Umutayb/element-acquisition-hotfix#1
Minor fixed to element acquisition
2 parents f65b7f9 + 6f20896 commit 4dd8798

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/main/java/pickleib/utilities/element/acquisition/ElementAcquisition.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,9 @@ public WebElement elementFromPage(String elementName, String pageName, SelectorT
694694
);
695695
JsonObject elementJson = getElementJson(elementName, pageName, objectRepository);
696696
assert elementJson != null;
697-
ByAll byAll = getByAll(elementJson, selectorTypes);
697+
ByAll byAll;
698+
if (selectorTypes.length > 0) byAll = getByAll(elementJson, selectorTypes);
699+
else byAll = getByAll(elementJson, SelectorType.xpath, SelectorType.css, SelectorType.text);
698700
return driver.findElement(byAll);
699701
}
700702

src/main/java/pickleib/web/driver/WebDriverFactory.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import pickleib.exceptions.PickleibException;
1616
import utils.LogUtilities;
1717
import utils.Printer;
18-
import utils.StringUtilities;
1918
import java.io.IOException;
2019
import java.net.URL;
2120
import java.time.Duration;
@@ -127,11 +126,6 @@ public class WebDriverFactory implements DriverFactory {
127126
*/
128127
private static final Printer log = new Printer(WebDriverFactory.class);
129128

130-
/**
131-
* Logging utilities.
132-
*/
133-
private static final LogUtilities logUtils = new LogUtilities();
134-
135129
/**
136130
* Initializes and returns a driver of specified type
137131
* @param browserType driver type
@@ -154,7 +148,7 @@ public static RemoteWebDriver getDriver(BrowserType browserType){
154148
if (deleteCookies) driver.manage().deleteAllCookies();
155149
if (maximise) driver.manage().window().maximize();
156150
else driver.manage().window().setSize(new Dimension(frameWidth, frameHeight));
157-
driver.setLogLevel(logUtils.getLevel(logLevel));
151+
driver.setLogLevel(LogUtilities.getLevel(logLevel));
158152
log.important(browserType.getDriverName() + GRAY.getValue() + " was selected");
159153
return driver;
160154
}

0 commit comments

Comments
 (0)