WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Cannot Find Form Name


Question:

I have been fighting with a particular form for too long now.. have done quite a few but no luck here. Cannot seem to find the Form Name. I have also not had good luck with the sample OLE/IE analyze scripts that should tell me what's on the page.

Can you guys point me to something that can I can use to analyze pages for me? - Something I can easily adapt to see the page that is already loaded?I am trying to simply run the "Generate iDEN Claim" function in the attached page. And maybe others...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)HTTP://www.nascsupport.com/voucher.asp -->
<HTML><HEAD><TITLE>Sprint National ASC Support (nascsupport.com) - Electronic Voucher</TITLE>
<SCRIPT>
   <!--
   function PONumber() {
   If (document.frmMain.ascID.value != "" || document.frmMain.ascID.value > 0){
         nID = document.frmMain.ascID.options.selectedIndex - 1;//parseInt(document.frmMain.agent.value);
         document.frmMain.poNumber.value = arrPOs1[nID];
      }
   Else
      {
      document.frmMain.poNumber.value = "";
      }
   }
   // -->
</SCRIPT>

<META HTTP-equiv=Content-Type content="text/html; charset=windows-1252">
<META HTTP-equiv=pics-label
content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline v2.0" l gen true for "http://www.nascsupport.com" r (nz 1 vz 1 lz 1 oz 1 cz 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.nascsupport.com"  r (n 0 s 0 v 0 l 0))'><LINK
href="88_files/formatting.css" rel=stylesheet>
<STYLE type=text/css media=Print>.noprint {
   Display: NONE
}
#pborder {
   BORDER-BOTTOM: black 1px solid
}
</STYLE>

<SCRIPT language=JavaScript src="88_files/formatCurrency.js"></SCRIPT>

<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY bgColor=white leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
  <TBODY>
  <TR class=noprint vAlign=top><!-- row 1 -->
    <TD width=275 bgColor=#ffcc00 height=54 rowSpan=3><A
      href="http://www.nascsupport.com/index.asp"><IMG height=55
      src="88_files/sprint_logo_left.gif" width=180 border=0
      name="NASC Support"></A></TD>
    <TD vAlign=center width=425 bgColor=#ffcc00>
      <DIV align=right><A class=NORMAL
      href="http://www.nascsupport.com/mainMenu.asp">Home</A> | <A class=NORMAL
      href="http://www.nascsupport.com/logout.asp">Log
      Out</A>&nbsp;&nbsp;&nbsp;</DIV></TD></TR>
  <TR class=noprint vAlign=top>
    <TD vAlign=center bgColor=#ffcc00>&nbsp;</TD></TR>
  <TR class=noprint vAlign=top>
    <TD vAlign=center bgColor=#ffcc00>
      <DIV align=right>Welcome, Manager ASC, Wednesday, October 26,
      2005&nbsp;&nbsp;&nbsp;</DIV></TD></TR>
  <TR class=noprint vAlign=top>
    <TD bgColor=#ffcc00 colSpan=2>
      <HR align=center color=#000000 noShade SIZE=5>
    </TD></TR>
  <TR vAlign=top bgColor=#ffcc00>
    <TD colSpan=2>
      <CENTER><STRONG>Electronic Voucher</STRONG></CENTER></TD></TR>
  <TR vAlign=top>
    <TD colSpan=2><!--Display number of vouchers completed today For rep logged In-->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR>
          <TD><FONT face="arial, helvetica" size=2><B>Welcome, Manager
            ASC</B><BR>Vouchers completed today: <B>3</B>
      </FONT></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR class=noprint>
          <TD>
            <DIV align=center><STRONG>Non-Voucher
        Transactions</STRONG></DIV></TD></TR>
        <TR class=noprint>
          <TD>
            <DIV align=center><A class=NORMAL
            href="http://www.nascsupport.com/nvtrans.asp?transaction=1">upgrade</A>
            | <A class=NORMAL
            href="http://www.nascsupport.com/nvtrans.asp?transaction=2">replacement</A>
            | <A class=NORMAL
            href="http://www.nascsupport.com/nvtrans.asp?transaction=3">repair</A>
            </DIV></TD></TR></TBODY></TABLE><!--Form For recalling a specific claim number-->
      <FORM action=/voucher.asp method=post>
      <TABLE align=center border=1>
        <TBODY>
        <TR class=noprint>
          <TD>
            <CENTER><FONT face="arial, helvetica" size=2><B>Claim Number:
            </B><INPUT class=inputtext maxLength=15 size=25
            name=recallClaim></FONT></CENTER></TD></TR>
        <TR class=noprint>
          <TD>
            <CENTER><INPUT type=submit value="Recall Claim" name=faction> <INPUT type=submit value="Recall ESN" name=faction>
        </CENTER></TD></TR></TBODY></TABLE></FORM>
      <FORM action=/voucher.asp method=post><INPUT type=HIDDEN
      value="&#13;&#10;&#9;&#9;&#9;" name=claimNumber>
      <TABLE align=center border=0>
        <TBODY>
        <TR class=noprint>
          <TD colSpan=3>
            <CENTER><INPUT type=submit value="Last Claim" name=faction> <INPUT type=submit value="Generate iDEN Claim" name=faction>
            </CENTER></TD></TR></TBODY></TABLE></FORM>
      <FORM action=ascBilling.asp method=post>
      <TABLE borderColor=black borderColorDark=black align=center
      borderColorLight=black border=1>
        <TBODY>
        <TR class=noprint>
          <TD>
            <CENTER><FONT face="arial, helvetica" size=2><B>Monthly
            Snapshot</B></FONT></CENTER></TD></TR>
        <TR class=noprint>
          <TD><FONT face="arial, helvetica" size=2><B>Agent:</B></FONT>
            <Select name=agent> <OPTION value=2094 selected>The Cellphone
              Store (North Attleboro)</OPTION></Select> </TD></TR>
        <TR class=noprint>
          <TD>
            <CENTER><INPUT type=submit value="Get Snapshot" name=faction></CENTER></TD></TR></TBODY></TABLE></FORM></TD></TR>
  <TR class=noprint vAlign=top>
    <TD colSpan=2>
      <HR align=center width=700 color=#000000 noShade SIZE=5>
    </TD></TR>
  <TR class=noprint vAlign=top>
    <TD colSpan=2>
      <DIV align=center><A class=NORMAL
      href="http://www.nascsupport.com/logout.asp">Log Out</A> | <A class=NORMAL
      href="http://www.nascsupport.com/mainMenu.asp">Home</A></DIV></TD></TR>
  <TR class=noprint vAlign=top>
    <TD colSpan=2>
      <DIV align=center>© 2005 Sprint Nextel Corporation<BR>All Rights Reserved
      </DIV></TD></TR></TBODY></TABLE></BODY></HTML>

Answer:

When you don't know things name= or id= then you just need to inspect them for the values they contain...
#DefineFunction startMSIE(url)
   msie = ObjectCreate("InternetExplorer.Application")
   msie.addressbar = @FALSE
   msie.statusbar = @FALSE
   msie.menubar = @FALSE
   msie.toolbar = @FALSE
   msie.visible = @TRUE
   msie.navigate(url)
   WaitForMSIE(msie)
   Return(msie)
#EndFunction

#DefineFunction WaitForMSIE(msie)
   While msie.busy || msie.readystate <> 4
      TimeDelay(0.5)
   EndWhile
   Return
#EndFunction

url = StrCat(DirScript(), "55.htm")
br = startMSIE(url)

InputCollection = br.document.GetElementsByTagName("INPUT")
ForEach Input In InputCollection
   If StrIndexNC(Input.getAttribute("value"), "generate iden", 1, @FWDSCAN)
      Input.style.border = ".25mm solid red"
      TimeDelay(2)
      Input.click()
      Break
   EndIf
Next

;br.quit

Exit

Article ID:   W17169
File Created: 2007:07:03:14:28:34
Last Updated: 2007:07:03:14:28:34