How to set file for a silverlight upload button

69 views Asked by At

html:

<div id=“file”>
  <object data="data:application/x-silverlight-2," type="application/x-silverlight-2">
  ...
  </object>
</div>

I've manage to click the silverlight button using following code:

f = Browser.div(:id => "file")
Browser.driver.action.move_to(f.wd).click.perform

However, when the file upload dialog opens, how can I set the file?

I'm using ChromeDriver.

1

There are 1 answers

0
orde On

According to the documentation, watir-webdriver cannot interact with silverlight objects:

Watir will drive web applications that are served up as HTML pages in a web browser. Watir will not work with ActiveX plugin components, Java Applets, Macromedia Flash, or other plugin applications. To determine whether Watir can be used to automate a part of a web application, right click on the object and see if the View Source menu option is available. If you can view the HTML source, that object can be automated using Watir.