无法调试Selenium项目

时间:2019-05-09 12:24:19

标签: selenium debugging intellij-idea windows-10 docker-toolbox

首先,我从yaml文件(已添加)在Windows 10 home上启动Docker Toolbox。 我从IntelliJ Idea中的maven pom文件(我添加了它)运行selenium项目(使用硒的远程驱动程序),我添加了断点,单击debug并没有捕获到断点。我想知道-是因为Toolbox有自己的地址(不允许本地主机)还是其他原因?我已经尝试解决了很长时间,但无法解决。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>id</groupId>
<artifactId>projName</artifactId>
<version>1.0-SNAPSHOT</version>

<name>Name</name>
<url>https://google.com</url>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <overwrite.binaries>false</overwrite.binaries>
    <threads />
    <browser />
    <remote />
    <seleniumGridURL />
    <zestaw />
    <platform />
    <browserVersion />
    <proxyEnabled />
    <proxyHost />
    <proxyPort />
    <logPath />
    <screenshotPath />
</properties>

<repositories>
    <repository>
        <id>jcenter</id>
        <name>bintray</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>
<dependencies>
    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.9.12</version>
    </dependency>
    <dependency>
        <groupId>com.relevantcodes</groupId>
        <artifactId>extentreports</artifactId>
        <version>2.41.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>2.0.0-RC1</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <compilerVersion>1.8</compilerVersion>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <threadCount>${threads}</threadCount>
                <suiteXmlFiles>
                    <!-- <suiteXmlFile>${zestaw}</suiteXmlFile>--> <!-- ${suiteXmlFile} -->
                    <suiteXmlFile>${zestaw}</suiteXmlFile>
                </suiteXmlFiles>
                <systemPropertyVariables>
                    <browser>${browser}</browser>
                    <remoteDriver>${remote}</remoteDriver>
                    <gridURL>${seleniumGridURL}</gridURL>
                    <branch>${branchURL}</branch>
                    <logfilepath>${logPath}</logfilepath>
                    <screenshotDirectory>${screenshotPath}</screenshotDirectory>
                    <desiredPlatform>${platform}</desiredPlatform>
                    <desiredBrowserVersion>${browserVersion}</desiredBrowserVersion>
                    <proxyEnabled>${proxyEnabled}</proxyEnabled>
                    <proxyHost>${proxyHost}</proxyHost>
                    <proxyPort>${proxyPort}</proxyPort>
                </systemPropertyVariables>
            </configuration>
        </plugin>
    </plugins>
</build>

version: '2'
services:
  firefox:
    image: selenium/node-firefox-debug
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - hub
    environment:
      HUB_HOST: hub    

  hub:
    image: selenium/hub
    ports:
      - "4444:4444"

我希望捕捉到断点,但是没有捕捉到。

0 个答案:

没有答案
相关问题