Error code 500 on image upload with Selenium Java - selenium-webdriver

I am facing a problem with the image upload, manually I can upload the image, but with selenium I allways get the Error 500 image upload. (Error is on the website Server, not the selenium itself)
I am uploading image from Properties in Project, but happens also when I upload it from windows explorer.
I am using headless mode also.
This is the Error I get:
Exception
Type: imageupload.uploaderror
Message: Error uploading file
this is my code:
File file = new File(getClass().getClassLoader().getResource(BildName).getFile());
String imagePath = file.getAbsolutePath();
eHinzufuegen.sendKeys(imagePath);

Related

2sxc - Adam image upload within 2sxc fails with a misleading error

I was trying to upload an image file using Adam within 2sxc, but the upload fails and display a misleading error. It shows that the upload fails because the file is too large than the maximum upload size even though it's not.
DNN version: 08.04.02
2sxc version: 12.18.0
enter image description here

CORS issue in Chrome Browser using Unity WEBGL build and chrome extension

Introduction :
I am using Unity WebGL build to play contents on the Bowser, But In browser unity webgl build is taking time to load. So in order to not load the unity webgl library again and again, I have a chrome extension to load the unity webgl build once and play contents on it.
Contents are data driven, so once loaded it gets data [ Audio , video , json ] from s3.
I will play the contents using extension, if it is available. Else I will play content on the browser itself.
Test Scenario 1 :
Setup :
Chrome extension is Disabled ( developer mode ).
Steps :
Click on a content, it will play fine.
Now enable the chrome extension ( developer mode )
Try to play the same content, it will try to play in the Chrome extension, it plays fine.
Test Scenario 2 :
Setup :
Chrome extension is enabled ( developer mode ).
Steps :
Click on a content, it plays in the extension.
Disable the chrome extension ( developer mode )
Try to play the same content, it will try to play in the browser.
Error in chrome console :
Access to XMLHttpRequest at 'File url' from origin 'url' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
My findings :
In Test Scenario 2, when I try to play the content in extension , the data required are fetched and stored in the Indexed db of the browser.
When I try to play without extension, the browser is trying to fetch the data from the indexed DB since it is already downloaded and it fails with a CORS issue.
NOTE :
This issue will be solved, if we manually "Empty Cache & hard reload " the browser.
Image 1 : Loading content without extension - 1st time
link : https://drive.google.com/file/d/1QtfMWeHtYjpDy_8jQvmGN2siM5SCEQ4n/view?usp=sharing
Image 2 : Loading the same content again - second time
link : https://drive.google.com/file/d/1FNzZf_ZPXlCvF19Xhr3yUt3Y9xstMkf-/view?usp=sharing
Image 3 : TestScenario 2
link : https://drive.google.com/file/d/1vtCpYgsdQwAJ6hgPDCWSO_eajcdNrNHn/view?usp=sharing

Error uploading on S3 through amplify storage reactjs

I'm using the latest version of aws/amplify 3.3.7
This is the code
const s3Upload = async (file, id) => {
const filename = file.name.replace(/\s/g, '')
await Storage.vault.put(filename, file, {
contentType: file.type
})
}
When I try to upload small files (1 Mb zip file) it works fine, but when I try to upload bigger files ie 6 Mb zip file, I'm getting the error:
AWSS3ProviderManagedUpload - error happened while finishing the upload. Cancelling the multipart upload Error: Request failed with status code 40
Anyone faced this problem
I've been having the same issue where after around 5MB, Amplify uses multipart upload and it fails with the same error.
The fix for me was https://github.com/aws-amplify/amplify-js/issues/61
I added ETag to ExposeHeaders in the S3 bucket's CORS settings and it worked fine uploading a 10 MB file after that.

Robot framework - Selenium - ChromeOptions "Prompt For Download" not working when downloading a file

I'm using robot framework with selenium for automating my web application.
I'm trying to open chrome browser and download a XML file and then parse it from the results folder ${OUTPUT_DIR}.
Every time I'm trying to download any file, chrome browser shows the windows prompt to download the file. I tried using the chrome options to disable the prompt, but it is not working. Please find the piece of code used to invoke chrome browser.
When tried using the regedit - PromptForDownloadLocation variable, it is working fine.. but I want to manage this using chromeOptions
Could you please help me with this.
ChromeDriver version : 79.0.3945.36
Robotframework - SeleniumLibrary version : 3.3.1
Create Webdriver and Open Browser
${CHROME_OPTIONS} = evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
${prefs} = create dictionary download.prompt_for_download=${FALSE} download.directory_upgrade=${TRUE} download.default_directory=${OUTPUT_DIR} safebrowsing.enabled=${TRUE}
call method ${CHROME_OPTIONS} add_experimental_option prefs ${prefs}
create webdriver Chrome chrome_options=${CHROME_OPTIONS}

Frame load interrupted when downloading excel files

I have an Angular script which goes to my server and grabs some data. The call looks like the following:
$http.post(url).success(function(response) {
// Do some work...
// Go to the link that the server provided
window.location.href = response.link;
});
So the user will then be redirected to download the file (the file is hosted on S3). The file downloading and everything works...but in Safari I get the following in my console:
Failed to load resource: Frame load interrupted
This is despite the fact that the file was downloaded successfully! Is there anything i'm missing here? No other browser has this error, however, even in Safari, the file downloads and I still get the error.

Resources