Selenium 我们可以使用appium android读取移动设备上可用的pdf文件吗

Selenium 我们可以使用appium android读取移动设备上可用的pdf文件吗,selenium,automated-tests,appium,appium-android,Selenium,Automated Tests,Appium,Appium Android,我想验证pdf文件中写入的文本是否符合我的第一件事 需要从pdf文件中读取数据是否有任何方法可以做到这一点 注意:该文件在移动设备中可用如果您在应用程序测试中使用Java,您可以尝试。此库支持以可视和文本模式比较PDF文件 首先获取您的PDF文本: import com.testautomationguru.utility.PDFUtil; PDFUtil pdfUtil = new PDFUtil(); //returns the pdf content - all pages Strin

我想验证pdf文件中写入的文本是否符合我的第一件事 需要从pdf文件中读取数据是否有任何方法可以做到这一点
注意:该文件在移动设备中可用

如果您在应用程序测试中使用Java,您可以尝试。此库支持以可视和文本模式比较PDF文件

首先获取您的PDF文本:

import com.testautomationguru.utility.PDFUtil;

PDFUtil pdfUtil = new PDFUtil();

//returns the pdf content - all pages
String pdfText = pdfUtil.getText("/path/to/file.pdf");
然后,为了与预期文本进行比较:

pdfText.contains(.. 

要访问设备上的PDF文件,您可以尝试

//爪哇


byte[]pdfFile=driver.pullFile(“/internal storage/downloads/filename.pdf”)

如何查找移动设备上可用文件的路径我的文件位于internal storage/downloads/filename.pdf中,因此您的意思是我需要使用byte[]fileBase64=driver.pullFile(“/internal storage/downloads/filename.pdf”);看一看pdf utl和pull文件的文档,然后在代码中尝试这些库,并用更实际的要点更新您的问题。
pdfText.matches(..