Skip to content

Commit f2b824e

Browse files
docs: Replace deprecated new URL(String) with URI(String).toURL() (#2263)
1 parent aa42e78 commit f2b824e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ UiAutomator2Options options = new UiAutomator2Options()
174174
.setApp("/home/myapp.apk");
175175
AndroidDriver driver = new AndroidDriver(
176176
// The default URL in Appium 1 is http://127.0.0.1:4723/wd/hub
177-
new URL("http://127.0.0.1:4723"), options
177+
new URI("http://127.0.0.1:4723").toURL(), options
178178
);
179179
try {
180180
WebElement el = driver.findElement(AppiumBy.xpath("//Button"));
@@ -193,7 +193,7 @@ XCUITestOptions options = new XCUITestOptions()
193193
.setApp("/home/myapp.ipa");
194194
IOSDriver driver = new IOSDriver(
195195
// The default URL in Appium 1 is http://127.0.0.1:4723/wd/hub
196-
new URL("http://127.0.0.1:4723"), options
196+
new URI("http://127.0.0.1:4723").toURL(), options
197197
);
198198
try {
199199
WebElement el = driver.findElement(AppiumBy.accessibilityId("myId"));
@@ -214,7 +214,7 @@ BaseOptions options = new BaseOptions()
214214
.amend("mycapability2", "capvalue2");
215215
AppiumDriver driver = new AppiumDriver(
216216
// The default URL in Appium 1 is http://127.0.0.1:4723/wd/hub
217-
new URL("http://127.0.0.1:4723"), options
217+
new URI("http://127.0.0.1:4723").toURL(), options
218218
);
219219
try {
220220
WebElement el = driver.findElement(AppiumBy.className("myClass"));

0 commit comments

Comments
 (0)