How to open any file from desktop in keyword test
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to open any file from desktop in keyword test
Hi, I want to open a PDF file from desktop using keyword test operation. For this which operation can I use? I tried aqFile.OpenTextFile and it ran without an error but file didn't open.
thanks
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some requirements here for working with PDF files. There are also some keyword test examples. See if this helps.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Marsha_R Thanks for your response. Unfortunately, my testcomplete version 14.20 does not have Intelligence Quality add-on enabled and that's stopping me to validate PDF files. Do we have any other alternatives or we must need to enable this add-on which will cost us extra bucks?
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If i'm not mistaken the only method available to you is importing external java library, but a) its usage is restricted to scripts and b) it's a bit complicated. You can find great tutorial online: https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete/. But beware: library referred in this tutorial treats pdfs as txt files, so it is easy to work with text, but no so much when more complicated stuff is involved (fonts, pictures, page layout).
I don't believe you can achieve something like that in keyword tests without paying for add-on.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you get a text version of the document and save it in the same place as the pdf? That way you can still make sure that the storage area is accessible to TC and you can compare a text file rather than a pdf. It's not exactly the same test, but I'm guessing that you are more interested in the content of the document rather than the fact that it's stored as a pdf.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@bach_ls thanks for your reply but I was more interested in Keyword Test, I know we can achieve this by script.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Marsha_R Thanks I will follow this method for PDF comparison.
Sorry I took the discussion to other point. I was looking for Keyword operations to open PDF file from the desktop. The link you gave me in your first post doesn't give much information about that. There must be some operations available in Keyword Test to open PDF file.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Kanwar
You can try File verification
I did the same for PDF and it worked perfectly fine
Stored the Master PDF in the Stores > Files
and than compare the file with Baseline it will do comparing by bytes.
Code : Files.Items(FileName).Check(SavePDFPath);
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There aren't always Keyword Test options for everything. That's why you can use Run Code Snippet or Run Script Routine inside a keyword test to extend the functionality.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for helping, Community! Great job here!
Hi @Kanwar ! Have you tried the recent suggestions in this thread? Do they help?
Sonya Mihaljova
Community and Education Specialist
