Is there a way to simulate dropping a file from the file system onto
an element using web driver?
Thanks
I had a similar problem and ended up running a crude apple script that
did what I needed and was called via command line followed by a sleep.
Really hackety, but it worked, however it can't be run on any non OSX
OS.
> --
> You received this message because you are subscribed to the Google Groups "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
>
--
Danial Jaffry
(714) 312-6208
On Dec 2, 2:07 pm, brianm709 <brianm...@gmail.com> wrote:
No,
Selenium can’t interact with OS level dialogues. To do something like this you would have to use something like a Java robot class, or a third party program (e.g. AutoIT for windows).
The only way to get it working using a pure selenium implementation would be to use the selenium file upload methods (assuming that this has not overridden the normal way to upload a file and made it impossible for Selenium to do this).
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/6pZ_okHvwF4J.
For more options, visit https://groups.google.com/groups/opt_out.
If you need to do it in Java write a Java robot class as I said in my last message. It will be hard to write, awkward to maintain and probably isn’t worth the effort in my opinion, but that’s how to do it if you really want to.
I would question why you need to specifically check the drag and drop functionality, but I suspect I’ll get an answer like “because we were told this had to be tested”.
Why do you specifically *need* to drag and drop them? Why can’t you pass an absolute path to the file in using .sendKeys()?
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/6pZ_okHvwF4J.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
Having a quick look at it, it would seem that the way to handle this via Selenium would be to have a look at the JavaScript code and work out what happens when a window.ondrop is triggered. I suspect it is somehow working out a reference to the local file location and using that to do everything else. If so you just need to trigger the ondrop event with this reference.
The above is very simplistic and I suspect it’s not going to be as easy as I’ve made it sound above, but it must be said that this seems like a very convoluted way for you to create a report from your HAR file. A quick google throws up:
http://www.frogthinker.org/projects/harlib
Which would enable you to read HAR files in as java objects and then you could plug the data into jgraph (or something similar). I suspect something that did this may become very useful if you then open sourced it.