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.
Related
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.
In Intellij IDEA 2019.3.3, I have a java project with selenium, testng and extent reports which runs automated tests on a website. The code generates html reports for the tests and saves screenshots of test failures to display them in the reports. The code puts the absolute path for screenshots in the html code of the failed tests in these reports.
When I open a html test report via Intellij (report > right click > open in browser > chrome), the thumbnail of the screenshot is not present. There is no placeholder either. Is this bug? If not, then do I need to change any setting in Intellij IDEA for the thumbnail to show up?
PS - I tried to open the report with chrome and firefox and faced the same issue. I have not tested this with a simple java project having an html page in a folder in that project. You can try it.
I don't know if this is a bug or a feature in Intellij IDEA. But, the simple solution is to open your html report directly with your browser. The image thumbnails show up there.
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.
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'?
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).