Article

dguest's picture
article
Reads:

3535

Score:
0
0
 
Comments:

0

Search Exclusions in NSL

Author Info

28 February 2007 - 6:34am
Submitted by: dguest

(View Disclaimer)

Problem

A Forum reader recently asked:

"Below is a section from one of my scripts that makes sure logon.jsp appears in the URL; then it makes sure the Login, Organization, User ID, and Password are found on the page; then users are logged in. Is there a way to search every page except for 2 or 3 in particular - such as a way to say "If every page except for search.asp and logo.jsp, then ...?"

geturl ?url

If "logon.jsp" -in ?url
   DebugPrint "We have reached login page."
   Delay 200
   If -text "Log In" "Organization" "User ID" "Password"
      Type $Username #2
      Type $Password #3
      Submit
   EndIf
EndIf

And here's the response from SecureLogin expert David Guest ...

Solution

If you use a regsplit to get the text before the .?sp, then you can do a reverse search.

GetURL ?URL
Regsplit "http://.*/(.*)\..sp.*" ?URL ?Page
If ?Page -In "logon search logo"
Else
#Do your thing here
EndIf

This will match the string before .?sp (it should be "logon" or "search" or similar) and store it to ?Page. You then check to see if ?Page is in the list of recognized pages.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell