Uploading image in project

My AUT contains a few “Upload image” features that I wish to test out. The test case for that, if I recall correctly, would be as follows :

  • click on the button to upload the image

  • upload the image

  • wait for page load

  • verify that the image is on the page, in a specified container

I know of how to upload file via absolute pathname, as well as how to wait for image to be present. The issue is that, with the uploading of file, it is done via absolute pathname, which creates portability issues as well as defeating the purpose of the project structure (projects should contain all the relevant static data, including image dependencies).

Is there a way to upload file via relative pathname, if not use the image saved to a test object to perform the upload?

try to use profiles - setup global variable for each env. and then use it based on profile
https://docs.katalon.com/pages/viewpage.action?pageId=13697476

Andrej Podhajský said:

try to use profiles - setup global variable for each env. and then use it based on profile
https://docs.katalon.com/pages/viewpage.action?pageId=13697476

How does storing a String answer the question? Are you trying to suggest me store the absolute path of the image to a global variable?

that, or store only part that differs on environments

another way is to store path to your project using something like:

myPath = System.getProperty("user.dir")

and use that variable to create fullpath