Skip to content

TestNG makes System.getProperty("user.dir") to return the parent project's root directory, which is wrong. #22

@kazurayam

Description

@kazurayam

I made a tag issue22 to reproduce this problem. You can checkout the issue22 tag and see on your machine.


I ran:

:~/github/selenium-webdriver-java ((issue22) +)
$ ./gradlew -q :selenium-webdriver-testng:test --tests="*ch05.cdp.FullPageScreenshot*"

I expected that a file fullpage-screenshot-chrome.png will be written into the subproject's root directory. So I exected find a file

  • ./selenium-webdriver-testng/fullpage-screenshot-chrome.png

However, in fact, I found the fullpage-screenshot-chrome.png file is written into the parent project's root directory, as shown in the following tree.

$ tree -L 1
.
├── LICENSE
├── README.md
├── alternatives
├── build
├── docs
├── fullpage-screenshot-chrome.png    <==== why this file is written here ?!
├── fullpage-screenshot-firefox.png   <==== why this file is written here ?!
├── gradle
├── gradlew
├── gradlew.bat
├── pom.xml
├── selenium-ide
├── selenium-webdriver-junit4
├── selenium-webdriver-junit5
├── selenium-webdriver-junit5-seljup
├── selenium-webdriver-testng
└── settings.gradle

10 directories, 8 files

I don't think I can solve this problem. It's too weired. I have no clue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions