Contributions
Re: Automate the Download of PDF files from Chrome
I also want to be able to control where the downloaded file gets put, so that I can locate and run a comparison or test text content. I don't want all files downloading to the same Chrome Download folder. I want to set this programatically, since we run these via Jenkin's pipeline jobs.2KViews0likes0CommentsRe: Automate the Download of PDF files from Chrome
It looks like there are three scenarios that we are dealing with. First, I needed to switch-off the Adobe Acrobat Chrome Extension: 1. Direct Path to PDF generated on web server Solution: Use Java IO Buffered Intput Stream. //var url = JavaClasses.java_net.URL.newInstance("http://pathToServer/ServerName?&reportname=Custom_Bol_##########&type=pdf&fileextn=.pdf,Custom_Bol_WM011111111111"); var url = JavaClasses.java_net.URL.newInstance("http://pathToPDF/PDFile.pdf"); var inputStream = url.openStream(); var fileParse = JavaClasses.java_io.BufferedInputStream.newInstance(inputStream); var docObj = JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_3(fileParse); var textStripperObj = JavaClasses.org_apache_pdfbox_text.PDFTextStripper.newInstance() outputString = textStripperObj.getText(docObj); docObj.close(); Log.Message("Output PDF String = " +outputString) 2. PDF loaded using a long URL and displayed in non-preview mode Solution: In this scenerio, I can type 'CTRL S', and save via the Open File Dialog to the folder I need. This I'm still working on find a reliable method to wait for the PDF file to load in Chrome (Other than a static wait). After downloaded, I can use the following code: var firstPDF = ProjectSuite.Path + "\pathToPDF\\BOL_Test.pdf"; var outputString = ""; var orderNumber = "60022500" var browser = Aliases.browser; browser.pageReportserv.Keys("^s"); var dlgSaveAs = browser.dlgSaveAs; var comboBox = dlgSaveAs.DUIViewWndClassName.Explorer_Pane.FloatNotifySink.ComboBox; comboBox.SetText(firstPDF); dlgSaveAs.btnSave.ClickButton(); var doc = JavaClasses.java_io.File.newInstance(firstPDF) var docObj = JavaClasses.org_apache_pdfbox_pdmodel.PDDocument.load_2(doc); var textStripperObj = JavaClasses.org_apache_pdfbox_text.PDFTextStripper.newInstance() outputString = textStripperObj.getText(docObj); docObj.close(); Log.Message("Output PDF String = " +outputString) // Run a basic test to find a string of text if (aqString.Find(outputString, orderNumber) != -1) Log.Message("Found Order #: " +orderNumber) else Log.Error("Didn't find Order # in search string."); 3. PDF Generated in Preview Mode (Read Only) Solution: I'm still working on a way to either download using CTRL 'S' or Buffered Input Stream. The URL is also lond a has many special characters (for spaces, etc.).2KViews0likes1CommentAutomate the Download of PDF files from Chrome
Does anyone know of a reliable way to interact with Adobe Reader embedded within Chrome to download PDF files? It appears to be using a 'Flex' control to download. I've tried to set the default download path, but this doesn't always automatically download the generated PDF. There are still dialogs that have to be interacted with. Thanks!2.1KViews0likes5CommentsRe: Fetch rows and column values from a custom built table in AngularJS web application
Sometimes you can execute the 'getItemCount()' method to get the # of rows/items from the table. I've have some success using this with SWT controls. This might not be available for the custom Angular controls.3.8KViews0likes0CommentsRe: Unable to get Chrome test extension installed
Sorry for the confusion. The crx file has always been in the Common Files folder, but not in the bin. For whatever reason, the installer is not updating Chrome with the extension. When I try to manually drag the crx file into the Chrome Extensions page, I get the following error: 'Could not install package: 'COULD_NOT_GET_TEMP_DIRECTORY' error. I shouldn't have to do this manually (I installed Chrome first, then TestExecute). I'm not sure if it is the TestExecute installer not able to map to the correct folders?2.3KViews0likes4Comments- 2.3KViews0likes8Comments
- 3.2KViews0likes10Comments