Selenium RC > how to upload file using attachFile()

后端 未结 8 781
谎友^
谎友^ 2021-02-04 14:02

I am using Selenium RC with Junit framework. I am trying to upload a file using attachFile() method.

attachFile: (Information collected from selenium API http:/         


        
8条回答
  •  感情败类
    2021-02-04 14:25

    Using Selenium / Rspec / Internet Explorer My solution was to create an AutoIt script on my windows machine

    WinWaitActive("Choose File to Upload")
    Send("c:\tests\school.jpg")
    Send("{ENTER}")
    run("selectfile2.exe")
    

    Then run this as an administrator on the windows machine. Right-click on the exe file and run as admin.

    Then rspec does a page.click "id of your browse button". When the Browse Window opens on the windows machine, AutoIt autofills the text box and it closes. Hopes this helps someone because this was driving me nuts.

提交回复
热议问题