![](/img/trans.png)
[英]Need to open each login in the same browser window by reading mailids and passwords from a CSV file using Java in Selenium
[英]How to open file:///sharedDrive url in same window in browser using java
我嘗試在瀏覽器的新窗口中打開 file:///sharedDrive url 使用
<button onclick="myFunction()">Folder</button>
<script>
function myFunction()
{
window.open("file://///sharedDrive/folder/");
}
</script>
它在 IE 中的打開 url,但不是在 Firefox/Chrome 中。
即使我試圖打開這個網址使用
reponse.sendRedirect("file://///sharedDrive/folder/");
但是它在打開這個 url 之前附加了 localhost:port\\。
恕我直言,無論如何都無法在chrome中打開文件,但它會被下載。 即使您直接在地址欄中輸入 file:// url,無論是共享文件還是本地文件,都會發生同樣的情況。 唯一的例外是 pdf 和圖像。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.