How to control file chooser with Selenium 2? - testing

The selenium website claims:
It drives the browser much more effectively and over comes the
limitations of Selenium 1.x which affected our functional test
coverage, like the file upload or download, pop-ups and dialogs
barrier
But I know only of more or less strange hacks using AutoIt or AWT KeyEvents.
So, how can I tell Selenium to put a certain path into the file dialog (not the form element that opened the file dialog!) and click on 'OK'?

Related

PDF url is behaving differently in Selenium and normal application

i am facing a weird issue in Selenium. i have a option in my application, and when i click on that option it will open a pdf file in new window. but when i am running the same in Selenium Java Automation it is downloading the file from that option. (it is opening new tab quickly and file started downloading and new tab also closed once file started downloading)
does any body have a solution for this.

Selenium IDE Load Text From File

I have installed Selenium IDE for Chrome as well as Selenium Side Runner, NodeJS, and ChromeDriver. I am able to successfully create a .side project and run it against a website. However, I have not been able to figure out how to read text from a txt file (just a single numeral in this case) and insert it into a form field on a site. I have previous experience with iMacros, so I attempted to use some of that knowledge to get Selenium to read the file but with no luck. If I edit the .side file in Notepad++, it is mostly just css with embedded commands, so I am really not sure of next steps. Any assistance would be appreciated.

Selenium ChromeDriver SendKeys breaks jQuery File Upload Plugin

I'm creating a UI test for a page with async file upload experience using Selenium ChromeDriver. File upload is implemented using jQuery File Upload Plugin (https://github.com/blueimp/jQuery-File-Upload) which enhances an input type="file" with additional functionality like async upload, multiple files upload, drag-n-drop support etc.
As you know, the recommended way to deal with standard input type="file" in Selenium tests is something like
driver.FindElement(By.Id("fileinput")).SendKeys(#"c:\test.txt");
However, it does not work with this plugin. The server-side (in my case it is an MVC controller's POST action) does not get any calls from the client and when I open Chrome DevTools Console I can see the actual error Failed to load resource: net::ERR_FILE_NOT_FOUND (basically it complains about the unreachable server URI).
At the same time manually it works perfectly fine (when I navigate to the page, click Upload, choose file in Open file dialog and press Open). So it seems the problem can be in between Selenium and the upload plugin itself.
Has anyone else faced with the similar issues using jQuery File Upload Plugin + Selenium ChromeDriver? I'm running ChromeDriver version 2.9 and jQuery File Upload version 5.40.0.

Recording Selenium tests from a web application.

We have a web application written in Flex we'd are already testing using Selenium. If you were tasked with investigating some solution that allows a user to press a record button from within the application and actually record a Selenium test, where would you begin?
I guess you'd need to wrap the whole Flex element in some something that is able to intercept clicks as well as track input. Is that even possible?
for this, You have to record this event using Autoit Recorder. After compiling Autoit script .exe file will be generated.
So you can test that part by executing this .exe file from selenium RC

Selenium with SWFUpload

I tried to use Selenium for the automation testing script. The testing web page used SWFUpload for uploading. I don't see any api in Selenium to resolve the upload.
Here is the page: http://demo.swfupload.org/v220/multiinstancedemo/index.php
I found flash-selenium but it is not useful.
http://code.google.com/p/flash-selenium/
Thanks,
Jame
One way of uploading documents is by using autoscripts.
However, autoit scripts are only supported on a windows machine.
You need to do following:
Click on browse button.
Run the .exe autoit file.(exe file can be converted from autoit scripts).