Solved

VBSCRIPT: Login to .asp page, 'Click' on Inquiry, Enter multiple invoice numbers in box, submit, print report

Posted on 2009-05-14
8
610 Views
Last Modified: 2013-12-08
I am Completely new to interfacing with IE  (besides manually :-)
and the searches I have performed to try and learn what I need for my project haven't helped me.
The first and most important part of this question is my being able to login to this 'portal'.  Again, none of the searches I've performed to figure this out have helped. (part of it might be I don't know the correct terminology to use).  I thought I had found one example that might help me -- but it just refreshes the page leaving the username and password blank.  I think it might have something to do with it being an .asp page?

To make a long story short - Below is what I need to do.  Please help.  Again - the login portion is the most important -- as I have not found ANY references to this that can help me.

I need to login to https://my.cassport.com/CISFBSYS/Login/login.asp
Which will bring up the Reporting Page (see CASS_reportingpage.doc)
At this point I need to "click" on INQUIRY, which will bring up the Inquiry Page (see CASS_inquirypage.doc)
Then I need to loop through a Text file a MAX of 25 times and place the Invoice number in the box provided. (The search allows for 25 invoice numbers to be queried at one time).
Once 25 or Less invoice numbers have been entered into the box, I need to "click" on Search button.
The results are then returned (see CASS_resultspage.doc)
In the bottom right-hand of the screen there is a Print button.  I need to click this button (not Print from the File menu).  A box then opens stating that a New Window will be opened.  I have to click OK, and then the process opens the New Window.
I need to then take the New Window and from IT'S File menu, select Print and save the file as a Web Archive, single file (*.mht).
CASS-inquirypage.doc
CASS-reportingpage.doc
CASS-resultspage.doc
0
Comment
Question by:SRG041808
  • 8
8 Comments
 

Author Comment

by:SRG041808
ID: 24384815

ok.. I finally got the Login part... proceeding on to step 2...  
Help is still greatly appreciated!!
0
 

Author Comment

by:SRG041808
ID: 24384829
as info -- here is my script so far  (Only have the login down :-)

strLogin = "https://my.cassport.com/CISFBSYS/Login/login.asp"
Set oie = CreateObject("InternetExplorer.Application")
oie.Visible = True
oie.Navigate (strLogin)
While oie.Busy: Wend ' wait for page to load...
oie.Document.Forms(0).txtLoginID.Value = "user"
oie.Document.Forms(0).txtPassword.Value = "pword"
oie.Document.Forms(0).submit
0
 

Author Comment

by:SRG041808
ID: 24384849
Login porition taken from solution posted by egl1044 on another question.
0
 

Author Comment

by:SRG041808
ID: 24385155

Now - I try to navigate to the Inquiry page so I can enter my invoice numbers -- and it pulls the login.asp back up.
I simply added the following to the above script:
strInquiry = "https://my.cassport.com/CISFBSYS/Inquiry/Inquiryfs.asp?Type=C"
oie.Navigate (strLogin)  
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:SRG041808
ID: 24385201
duh... I see my mistake -- I copied and pasted -- without changing strLogin to strInquiry
0
 

Author Comment

by:SRG041808
ID: 24385720

Figured out everything else -- Now need to access FILE menu in IE, Choose SAVE AS, and Save the page as filename.MHT (Web Archive, single file (*.mht)
 
0
 

Author Comment

by:SRG041808
ID: 24385736

Dim strLogin 'As String
strLogin = "https://my.cassport.com/CISFBSYS/Login/login.asp"
'
Set oie = CreateObject("InternetExplorer.Application")
'
oie.Visible = True
oie.Navigate (strLogin)
'
While oie.Busy: Wend ' wait for page to load...
'
oie.Document.Forms(0).txtLoginID.Value = "user"
oie.Document.Forms(0).txtPassword.Value = "pass"
oie.Document.Forms(0).submit
strInquiry = "https://my.cassport.com/CISFBSYS/Inquiry/InquirySearch.asp?Type=C"
oie.Navigate (strInquiry)
While oie.Busy: Wend ' wait for page to load...
'invoice numbers will be variables that are set from a text file...
oie.Document.Forms(0).txtNumbers.Value = "1009046354" & Chr(13) & "1431006428"
oie.Document.Forms(0).submit
'
'invoice numbers will be variables that are set from a text file...
strPrint = "https://my.cassport.com/CISFBSYS/Inquiry/Inquiryprint.asp?txtNumbers=1009046354%2C1431006428&InquiryType=P&Type=C&SuffixSelect=S&print=1"
'
oie.Navigate (strPrint)
'
'NEED CODE TO DO FILE-SAVEAS .MHT FILE
Set oie = nothing
0
 

Accepted Solution

by:
SRG041808 earned 0 total points
ID: 24386645

How can I specify which File type to select when trying to save a WEB Page? I want it to save as an MHT.  (I've added some sendkeys to the code to save the web page -- but I can't figure out how to change the filetype to Web Archive (.mht).
Dim strLogin 'As String
strLogin = "https://my.cassport.com/CISFBSYS/Login/login.asp"
'
Set oie = CreateObject("InternetExplorer.Application")
'
oie.Visible = True
oie.Navigate (strLogin)
'
While oie.Busy: Wend ' wait for page to load...
'
oie.Document.Forms(0).txtLoginID.Value = "user"
oie.Document.Forms(0).txtPassword.Value = "pass"
oie.Document.Forms(0).submit
strInquiry = "https://my.cassport.com/CISFBSYS/Inquiry/InquirySearch.asp?Type=C"
oie.Navigate (strInquiry)
While oie.Busy: Wend ' wait for page to load...
'invoice numbers will be variables that are set from a text file...
oie.Document.Forms(0).txtNumbers.Value = "1009046354" & Chr(13) & "1431006428"
oie.Document.Forms(0).submit
'
'invoice numbers will be variables that are set from a text file...
strPrint = "https://my.cassport.com/CISFBSYS/Inquiry/Inquiryprint.asp?txtNumbers=1009046354%2C1431006428&InquiryType=P&Type=C&SuffixSelect=S&print=1"
'
oie.Navigate (strPrint) '
Set objShell = CreateObject("WScript.Shell")
objShell.AppActivate "Cass Information Systems - Windows Internet Explorer"
objShell.SendKeys "%F"
WScript.sleep 100
objShell.SendKeys "A"
WScript.sleep 100
'will actually send filename variable
fn = "newtestfile"
objShell.SendKeys fn
WScript.sleep 100
objShell.SendKeys "%S"
WScript.sleep 100
objShell.SendKeys "Y"
'
Set oie = nothing
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now