I am running Selenium Tests on TeamCity 8.0.5 version. I am facing issue when I am trying to download some file to any path on Teamcity Server from website, but the file is not downloaded on Teamcity server rather it is downloaded on machine where my browser is running. However it works perfect when I run my tests through IntelliJ or command line. I am using Selenium Remote Webdriver.
Selenium RemoteWebdriver is on machine "abc" where my browser is executing tests.
TeamCity is installed on some other machine. I am accessting teamcity with URL http://teamcity.hm.com and invoking my tests via a separate branch created as a maven project.
In my code, I have given download path as :
String downloadPath = System.getProperty("user.dir")+"\\target";
So whenever I download something from my application say any image or pdf file, it is downloaded as a zip file at the above mentioned location.
But when I am trying to access my downloaded files through code as :
private String downloadPath = System.getProperty("user.dir")+"\\target\\Imagegallery.hmdownloadasset.zip";
private String basketDownloadPath = System.getProperty("user.dir")+"\\target\\Basket.hmdownloadasset.zip";
I get FileNotFoundException and the files are actually downloaded on the machine where my browser is running , though the code is running from TeamCity agent as a checkout, so the downloaded file should be present on Teamcity machine, but it is not there.
Please suggest what should I do, my tests are failing.
I am also attaching Build log as well.