Selenuim IDE - Test upload box with supported extensions - selenium

I have to create test steps within Selenium IDE to test file upload feature.
The allowed file extensions are JPG, PNG, BMP, JPEG, so if a user tried to upload say a PDF, Word or any other extensions the test should fail.
How can I configure this in the tool as steps ?
Thanks

Related

How to handle files uploading by using selenium script?

Please help me how to handle upload file and choose file functionality by using Please help me how to handle upload file and choose file functionality by using selenium script.|Please help me how to handle upload file and choose file functionality by using selenium script.|selenium script.|

How to download a file through a link with its extension type with scrapy

I am using scrapy to scrape a website and I can download the file from the page, however everything that is being download is a plain text file. How do I download it with it's extension type? I am downloading scripts and as such, having the proper extension type on my download is necessary.
For example, if I am downloading exploits from exploit-db, the link that I go to to download them would be for example: https://www.exploit-db.com/exploits/19832/
and the link i would extract from there to download from is https://www.exploit-db.com/download/19832 which will, if I click on it normally, download a ruby file. But through scrapy it gets saved as a text file. Is there a way to download it as a .rb through scrapy?
Just save it as filename.rb. All files are text/binary files. Extension is there just to tell your operating system what to use to understand that file.
(In some operating systems extension isn't even required since files have headers at the beginning of the file telling what they are)
You can do try this:
scrapy shell https://www.exploit-db.com/download/19832
Then in the shell or your spider just do:
with open('ruby_file.rb', 'wb') as ruby_file:
ruby_file.write(response.body)

How can I save Selenium/Selenese tests as .json files?

How can I store a Selenium test in a .json file?
I would like to store Selenium tests as a logic-less .json file. Selenium IDE allows tests to be saved as .html file (http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese), which is logic-less, but I really prefer to have data like this stored in a json file. Json makes it easier to work with test-runners like Nightwatch.js.
I do not want tests to be stored in .js, Java, Python, C#, Ruby formats.
It looks like Sauce Labs has developed a json format with its Selenium Builder: https://github.com/SeleniumBuilder/se-builder/wiki/JSON-Format

Load PDF in Vaadin from Resource

I designed a Document Viewer in Vaadin that displays PDF files to the user. I successfully added the PDF to the viewer by specifying the system path. The problem is when I run the Viewer in a remote system, the PDF isn't displayed. So is there any way to load the PDF using the resource like we load the images.
Here is my code:
File pdfFile = new java.io.File ("D:/WorkFiles/PDF Books/newsletter.pdf");
The pdf is loading only from the local system. I have tried adding the pdf in the themes folder, but it doesn't work.
Thanks in advance.
What about the https://vaadin.com/api/com/vaadin/server/StreamResource.html. You can use this for on demand generated PDF files.

Eclipse plugin for working with binary file formats

Can anyone point me to an Eclipse plugin for working with complex binary file formats such as TIFF, JPEG, PNG, etc? Ideally the plugin would allow the structure of the binary file to be described in detail and used to decode a file. Features such as structures, logical decisions, int/float/bool/flags expansion.