Коллеги, всем привет! Столкнулся со следующей проблемой, никак не могу решить или найти ответ. Создал новый maven проект, подключил JUnit и Selenide. Создал класс, где написал простой тест с открытием страницы по Url:
import org.junit.jupiter.api.Test;
import static com.codeborne.selenide.Selenide.open;
public class LoginPositiveTests {
@Test
public void loginTest() throws Exception {
open("Url");
}
}
Тест валится со следующей ошибкой: https://prnt.sc/xzi0k3
Полный стектрейс ошибки:
io.github.bonigarcia.wdm.config.WebDriverManagerException: java.nio.file.AccessDeniedException: C:\Users\User\AppData\Local\Temp\2000336787540245963\chromedriver.exe -> C:\Users\User\.cache\selenium\chromedriver\win32\88.0.4324.96\chromedriver.exe
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:777)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:574)
at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:793)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:774)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:574)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:767)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:574)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:288)
at com.codeborne.selenide.webdriver.ChromeDriverFactory.setupWebdriverBinary(ChromeDriverFactory.java:44)
at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriverInstance(WebDriverFactory.java:108)
at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriver(WebDriverFactory.java:71)
at com.codeborne.selenide.drivercommands.CreateDriverCommand.createDriver(CreateDriverCommand.java:68)
at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:153)
at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getAndCheckWebDriver(WebDriverThreadLocalContainer.java:139)
at com.codeborne.selenide.WebDriverRunner.getAndCheckWebDriver(WebDriverRunner.java:97)
at com.codeborne.selenide.impl.StaticDriver.getAndCheckWebDriver(StaticDriver.java:62)
at com.codeborne.selenide.SelenideDriver.getAndCheckWebDriver(SelenideDriver.java:189)
at com.codeborne.selenide.drivercommands.Navigator.navigateTo(Navigator.java:70)
at com.codeborne.selenide.drivercommands.Navigator.open(Navigator.java:32)
at com.codeborne.selenide.SelenideDriver.open(SelenideDriver.java:85)
at com.codeborne.selenide.Selenide.open(Selenide.java:49)
at LoginPositiveTests.loginTest(LoginPositiveTests.java:12)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.nio.file.AccessDeniedException: C:\Users\User\AppData\Local\Temp\2000336787540245963\chromedriver.exe -> C:\Users\User\.cache\selenium\chromedriver\win32\88.0.4324.96\chromedriver.exe
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:205)
at sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
at java.nio.file.Files.copy(Files.java:1274)
at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1392)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:885)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:835)
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:802)
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2273)
at org.apache.commons.io.FileUtils.moveFileToDirectory(FileUtils.java:2310)
at io.github.bonigarcia.wdm.online.Downloader.downloadAndExtract(Downloader.java:147)
at io.github.bonigarcia.wdm.online.Downloader.download(Downloader.java:90)
at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:653)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:568)
... 85 more
Process finished with exit code -1
Подскажите, пожалуйста, в чем может быть возможная причина. Если запускать тест с помощью WebDriver (т.е. в тесте прописать driver.get("Url")), браузер успешно открывает нужную страницу.