I am using Watir Webdriver selenium and trying to run:
browser.execute_script($("#CSVFileName").text("template.csv"))
I'm trying to execute javascript to change the FileName.csv to template.csv but doesn't appear to be working. Here is the code of the element from the browser.
<div class="uploader">
<div class="load-line" style="width:100%"></div>
<span class="name" id="CSVFileName">FileName.csv</span>
</div>
您似乎只是缺少脚本周围的引号-即execute_script
需要一个字符串:
browser.execute_script('$("#CSVFileName").text("template.csv")')
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.