Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Is command line checklinks tool different from GUI?

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
Is there any reason why a check links test in the GUI would return results and a command line checklinks test wouldn't?
  • I open the WebKing GUI and be sure to save my Check Links tool preferences. (I assume V6.0 command line invocation still uses the <userid>.wkp preference file when it runs?)
  • From the WebKing GUI, I click on the Check Links tool, browse to the folder of HTML files, and the results show 5 broken links. (yay!)
  • I use the following command to run test.wkscript, and the resulting XML file reports no errors. (I've even tried running without the -xml flag to a binary .rpt file and -html to an html file. Each resulting report is empty.)
Command:
CODE
wk.exe -cmd -genreport -run test.wkscript

Contents of test.wkscript:
CODEnewproject -local=C:\full-path-to-folder-with-HTML
checklinks
savereport -checklinks -xml checklinksRpt.xml
closeproject



-g-

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Hello gfaircl,

    The command line check links tools is the same tool as the GUI check links tool. You are correct that the <userid>.wkp file is used to get the check links preferences.

    Your command line and script are correct, and you should be seeing the same 5 errors as when you run check links from the GUI. There are a couple of possibilities for why you are not seeing errors.

    The most common oversight is to use an incorrect path for the newproject command. When running your script, you should see the following output:
    CODE
    $ wk.exe -cmd -genreport -run test.wkscript
    ---------- Loading C:\full-path-to-folder-with-HTML ----------
    Total changes - 1 page added, 0 pages removed
    ---------- Check Links ----------
    WebKing will not warn you if you have made an error in your path. Instead, you should look to see that "N pages added" is not "0 pages added" and that N is the number of pages you expect to be in your folder.

    Another possibility is that the preferences are not being saved before the test is run. I see that you are opening the WebKing GUI and checking to save the Check Links tool preferences. I would verify that you are doing so in the following way:Open the WebKing GUIConfigure the Check Links preferencesRun the Check Links tool on your local project and verify you get the expected number of errorsGo to File: Save PreferencesExit WebKingRun your command line script
    If you are still not getting the expected number of errors after verifying the path and preferences, please send your question in to webkingsupport@parasoft.com where we will continue to work with you to solve the problem.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Yep, I've made sure I'm pointing to the right directory (finds 20 files as expected) and I've saved the preferences many times just to be safe. Is there any way to know for sure that the preferences file for my userid is being loaded? I've only noticed this since I installed 6.0 and I wonder if from the command line some default system-wide preferences are being used somehow. (?)

    But, good idea, I'll definitely contact support. Since we have our own corporate group for support for WebKing, I'll hit them up first before bothering the Parasoft folks. If and when we get this thing resolved, I'll be sure to post the solution here.

    Thanks!

    -g-
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Hi gfaircl,

    Is there any way to know for sure that the preferences file for my userid is being loaded? I've only noticed this since I installed 6.0 and I wonder if from the command line some default system-wide preferences are being used somehow. (?)

    Thank you for checking the path and preferences. WebKing should be using the same preferences file from the command line as from the GUI. But if you would like to make sure that file is being used, you can pass the -wkp argument as follows:

    CODE
    wk.exe -cmd -wkp userid.wkp -genreport -run test.wkscript

    This will force WebKing to use "userid.wkp" as the preference file.