Solved
Forum Discussion
Hi I use this tuto https://support.smartbear.com/articles/testcomplete/testing-pdf-files-with-testcomplete/ with testComplete 10 to use PDFBox to compare 2 PDF.
But I can't load the PDF. I have this error: java.lang.illegalargumentexception argument type mismatch.
Can you help me Tahnks
tristaanogre
7 years agoEsteemed Contributor
As documented in that article you linked:
- In Java, methods can be overloaded. A method is called overloaded, if it has the same name as another method has, but uses different parameter sets. For instance, the load method below is overloaded:
load(URL url, Boolean force)
load(String filename)
load(InuptStream input)
When running Java code, the Java run time engine analyzes the parameter types and automatically calls the appropriate method. However, in TestComplete, this is not possible as all script variables have the Variant type. To distinguish different implementations of a method, TestComplete appends a postfix to the method name:load
,load_2
,load_3
and so on.
To get information about method names and parameters, examine the methods in the Code Completion window at design time. Alternatively, at run time, you can pause the script on a breakpoint and explore objects’ methods and properties with TestComplete’s Evaluate dialog.
So, you're using "load_3" but that method may be requiring an InputStream or a URL and boolean. Examine the methods to determine which one you need to do the filename. I would suggest that it might be "load_2".