简体   繁体   中英

watir click on javascript button

I try to upload a file in web site, but i cant find a solution for click in the button, if i try

@@browser.button(:name => "submit_btn").when_present.click

i get this error /net/protocol.rb:141:in `read_nonblock': end of file reached (EOFError)

Do you have an idea how i can click on the button ?

<center>

    <label for="tos"></label>
    <a href="tos.html"></a>
    <input id="tos" type="checkbox" onclick="if(this.checked){this.form.submit_btn.disabled=false}else{this.form.submit_btn.disabled=true};this.blur();" checked="" value="1" name="tos"></input>
    <br></br>
    <input class="btn" type="submit" value=" Upload! " name="submit_btn"></input>

</center>

尝试browser.element(:name => 'submit_btn').click

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM