Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用maven selenium插件启动浏览器会话时无法删除文件_Java_Eclipse_Maven_Selenium_Maven Plugin - Fatal编程技术网

Java 使用maven selenium插件启动浏览器会话时无法删除文件

Java 使用maven selenium插件启动浏览器会话时无法删除文件,java,eclipse,maven,selenium,maven-plugin,Java,Eclipse,Maven,Selenium,Maven Plugin,pom.xml看起来像 我在执行目标“mvn集成测试”时收到此错误消息,我有一个简单的测试用例,可以打开firefox浏览器并在谷歌搜索栏中搜索一些文本 到目前为止,我也重新安装了firefox浏览器,但再次失败 例外情况: java.lang.RuntimeException:无法启动Selenium会话:无法启动新浏览器会话:无法删除文件C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\customProfileDirb66b3e06cba84cc1b55eb72a418

pom.xml看起来像

我在执行目标“mvn集成测试”时收到此错误消息,我有一个简单的测试用例,可以打开firefox浏览器并在谷歌搜索栏中搜索一些文本

到目前为止,我也重新安装了firefox浏览器,但再次失败

例外情况: java.lang.RuntimeException:无法启动Selenium会话:无法启动新浏览器会话:无法删除文件C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\customProfileDirb66b3e06cba84cc1b55eb72a418a5c61\parent.lock 位于com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) 位于org.argus.selenium.timepass.TestSelenium.setUp(TestSelenium.java:16)

我是在配置中还是在运行mvn目标时遗漏了一些东西。

伙计们很有趣很奇怪。。。。 只需更改pom.xml即可

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>1.0</version>
            <executions>
                <execution>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start-server</goal>
                    </goals>
                    <configuration>
                        <background>true</background>            
                        <logOutput>true</logOutput>                             
                        <browserSessionReuse>true</browserSessionReuse>                             
                    </configuration>
            </execution>
        </executions>
    </plugin>

org.codehaus.mojo
selenium maven插件
1
预集成测试
启动服务器
真的
真的
真的
将版本号更改为1.0.1 应该是这样的

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
                <execution>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start-server</goal>
                    </goals>
                    <configuration>
                        <background>true</background>            
                        <logOutput>true</logOutput>                             
                        <browserSessionReuse>true</browserSessionReuse>                             
                    </configuration>
            </execution>
        </executions>
    </plugin>

org.codehaus.mojo
selenium maven插件
1.0.1
预集成测试
启动服务器
真的
真的
真的
这应该有效。

谢谢大家:)

您是否检查了上述临时路径以查看是否存在customProfilefolders?关闭您的FF浏览器,然后检查临时文件夹此临时文件夹存在,TaskManager还会向我显示一个在后台运行的firefox实例…但问题是firefox窗口不会弹出,测试不会播放,我的服务器退出,而此实例保持活动状态。
<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>1.0</version>
            <executions>
                <execution>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start-server</goal>
                    </goals>
                    <configuration>
                        <background>true</background>            
                        <logOutput>true</logOutput>                             
                        <browserSessionReuse>true</browserSessionReuse>                             
                    </configuration>
            </execution>
        </executions>
    </plugin>
<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
                <execution>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start-server</goal>
                    </goals>
                    <configuration>
                        <background>true</background>            
                        <logOutput>true</logOutput>                             
                        <browserSessionReuse>true</browserSessionReuse>                             
                    </configuration>
            </execution>
        </executions>
    </plugin>