English 中文(简体)
如果能够读取档案,那么ium如何能够测试
原标题:How selenium can test if it has read access to a file

Our test-app runs on multiple Virtual Machines through Selenium Remote Control. The App sits on a test controller Server.

The test-app is used to test a third party online application.

我怎么能检验一下,某些证书的Selenium-RC是否读过档案或文件。

是否有任何东西,如<代码>file.canRead(filepath),也有哪些东西可供 se?

Before you respond: File s canRead(filepath) will only test if the file is readable from a test controller server, not able to say anything if it is readable on VM where actual browsers are opening(testing) third-party-online-application.

基本上,我想通过 se将一些档案上载到第三方在线申请。

在上载之前,我希望确保文件能够上载(在履历上)。

问题回答

解决办法是在申请中建立下载链接,然后试图通过Selenium下载档案。 这样,你们就获得了用户代表的经验。

如果你真的ancy虚,申请书会生成一份现有日期的档案,然后让测试下载档案(简单文本档案)并在档案中注明日期。 然后,你测试申请书撰写,用户阅读档案,其中也包括查阅权。

你们使用哪一种文字? 如果假定您的上载文件属于“数据”目录,那么就可检查一下以下步骤:

File file = new File("./data/myfile.ext");
boolean canUpload = file.exists() && file.canRead();

String fileToUpload = file.getCanonicalPath(); //file name with full path
File file = new File("Folder_Location"); // Folder path if file name not known

boolean canUpload = file.listFiles()[index].canRead(); 

说明:最近下载的文档使用

int size=file.listFiles().length-1;

boolean canUpload = file.listFiles()[size].canRead();




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签