Selenium file download test case in Jenkins - selenium

I downloaded a file in one of my local folder(say CSV_downloads) using selenium and its working fine,but when I am pushing same code to Git and running it in jenkins,though that folder(CSV_downloads) exists in jenkins workspace(CSV_downloads) its not downloading csv to that particular folder(CSV_downloads) in jenkins.

If you use a hard coded location like C:\CSV_downloads then it will not be downloaded into jenkins folder. So you have to see the folder locations in local and remote machines.
Try to use relative paths like System.getProperty("user.dir") +"//folders.." where System.getProperty("user.dir") is your project folder.
also if the folder is not there then try to create directory like folderName.mkdirs();

Related

The issue with downloading files with Selenium with Jenkins

Testers may have this issue for sure.
Assume that we have a testcase that should be automated. And it has a step to download a file from the webpage by clicking a link and it will be downloaded to our local machine’s download folder. As the next step it should be verified that the file is downloaded.
So in a local machine this can be handled easily by using the download paths and all. But the matter that I have is this exact same testcase is getting fail in Jenkins (cloud run). It returns a null value because the download directory cannot be found in Jenkins.
Do you guys know what kind of solution that can we take for this? I heard something using API request to download the file. Yes this file is also getting downloaded by a GET request with parameters. But I don’t know how to perform that.
Thanks for your time.
I tried the bellow options.
Changing the directory to Windows and Linux as per the documents
By using jenkins home directory
What I want to do?
to verify that the file is downloaded
Read the file and check with the db (This has existing methods)

how to upload and then download files from application using Glassfish 4.1.1 and jelastic?

I was trying to upload and download files at application level using jelastic server in cloud and I have some issues during downloading the uploaded files
to upload the files I use:
File folder = new File(".." + File.separator + "customFolder");
and the files are uploaded correctly inside of:
/opt/GlassFish/glassfish/domains/customDomain/customFolder/
and I can see the files using jelastic dashboard and ssh
but, if I try to download them through application I have a 404 error
using this kind of approach
Link
I try to use the instructions posted here
Cann't get file from classpath (using NIO2)
but this doesn't work for me. Also I try to use some paths also posted in jelastic documentation (https://jelastic.zendesk.com/hc/en-us/community/posts/206122066-Uploading-Files-to-a-Specific-Folder) but noticed there is no a clear explanation for Glassfish.
Also I figure out that the files are in different locations inside of jelastic application folders
these are the different locations that I have found and tried to use to downloading the files (I changed the access permissions, also without making a successful download):
/opt/GlassFish/glassfish/domains/customDomain/customFolder/
/opt/repo/versions/4.1.1/glassfish/domains/customDomain/customFolder/
/opt/shared/glassfish/domains/customDomain/customFolder/
so my question is
what is the correct path to download the files or should I change the upload path?
an example using java code returning the string with the path for download would be appreciated
I'm using Glassfish 4.1.1 for the application

Where does intellij idea save the local storage and preferences of libgdx (pc)

I started working with files, a simple operation of writing and reading files.
But i had an error when writing a file and now i have to fix it by hand.
Thats the problem, i don't know where is my file.
Also i would like to see the file i'm writing.
I am working with intellij idea 2016 1.4, maybe the file is complied in a jar?
Yes, i know that clearing cache its an option.
nothing here: https://github.com/libgdx/libgdx/wiki/File-handling
on the wiki link only talk about where you can find the ablolute path file but thats not my case. I get the file this way:
this.resolver = Gdx.files.local(path + "item"+ String.valueOf(weaponNumber) + ".txt");
String description = this.resolver.readString();
So.. where is the file? thanks
In the desktop version it saves the file in the assets folder inside your android module.
FileHandle file = Gdx.files.local("myfile.txt");
file.writeString("Test libGDX", false);
System.out.println(Gdx.files.getLocalStoragePath());
Output: D:\Dropbox\Projetos\Outros\gdxTest\android\assets\
The project folder in my computer is gdxTest.
In your case you have the path var so probably will be a folder inside assets folder.
But when you pack the desktop game into a jar file, the file will be created in the same folder where your game jar file is located. Usually yourProject\desktop\build\libs.
The difference is because when we configure the desktop project we set the Working Directory in the yourProject\android\assets\ folder. So to Android Studio it is the local folder of your project.

Add chrome web driver in RIDE (robot framework)

I am new to robot framework.
I have put the chromedriver.exe file in the path of system. Now, when I am running scripts in RIDE I am getting this error:
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Is there is any other way of setting path in RIDE itself?
UPDATE: My path variable includes:
C:\Driver\chromedriver.exe;
As mentioned in the Robot framework installation guide,How to set the environment variables.
Place the chrome driver in te path "C:\Python\Scripts" and make sure this path "C:\Python\Scripts" is updated in environment variables.If you have any clarification check the below link.Under the heading Setting PATH on Windows
https://github.com/robotframework/robotframework/blob/master/INSTALL.rst
Download Chromedriver.exe from its official website, extract the .exe file and copy this .exe file in scripts folder of Python installation, e.g. C:\Python36\Scripts
After this, add this scripts path in Environment variable

Location for install.rdf

I am trying to write a plug-in for selenium UI and following this tutorial. Below is an excerpt from this.
First, what you need is an ‘install.rdf’ file and is located in the
root dir of your workspace
I am not sure what is root directory of workspace here mean. So I have firefox and selenium installed on my computer. Where exactly should I create this install.rdf
The root directory mentioned here is the root directory of the IDE source code. You can download IDE src code from location given below and put the install.rdf in the root.
Selenium IDE src code
Once you have made changes to the plugin src as per your needs. You can build it and install the .xpi hence built to your firefox instance like a regular extension and test it.