Jump to content
ohaya

How to handle multiple requests ?

Recommended Posts

Hi,

I have a situation where I need to make one request to get a kind of pre-logon page, then click a link on that pre-logon page, which then returns a login form page, and then fill in information in the form page and submit it.

How can I handle that using AutoIT?

I can get the AutoIT script to tab to the link, then send an ENTER, which then causes the FORM page to appear in IE.  However, I cannot seem to get the form object from the FORM page (_IEFormGetObjByName fails when it searches for the form).  Why is that, and how can I get the AutoIT to process the FORM page?

Thanks,

Jim

Share this post


Link to post
Share on other sites

Please post your code here to get additional help. Have you tried using _IEFormGetCollection to get the form details?

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("http://www.autoitscript.com")
Local $oForms = _IEFormGetCollection($oIE)
MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page")
For $oForm In $oForms
    MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name)
Next

 

Share this post


Link to post
Share on other sites
6 hours ago, PoojaKrishna said:

Please post your code here to get additional help. Have you tried using _IEFormGetCollection to get the form details?

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("http://www.autoitscript.com")
Local $oForms = _IEFormGetCollection($oIE)
MsgBox($MB_SYSTEMMODAL, "Forms Info", "There are " & @extended & " form(s) on this page")
For $oForm In $oForms
    MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name)
Next

Hi,

Yes, I am already using _IEFormGetCollection() (see this other thread about that: 

)

That (getting the form and the element works fine when I am working with the login page which I got to by using _IECreate(), but what I am asking about in this thread/subject is a kind of variant of the case where I get to the form login page "directly" by using _IECreate().

We (apparently) have some target web sites where instead of going to a form login page directly, when you first access the site, you get pa page with a link that takes you to the login page, something like:

image.png.18d9ebe4065ff40c9750b42eeadc383e.png

then, you click on the link that the browser shows the FORM login page (this is some kind of security measure, i.e., if someone is trolling the site, they would need to follow that link to log into the website).  [Note I think the login page is the same URI, so I am guessing it's like a hidden <DIV> or something that gets unhidden, but I'm not a web type person so not sure how they do that.]

I have tried the following so far using AutoIT:

- Sending some TABs to get to the link and then send an ENTER

- Use _IENAavigate() to get to the login page

I can get the log in page to appear in the browser, but when I try to do the _IE* stuff to get the form, etc., I am getting nothing, i.e., even though the browser is SHOWING the form, etc., using the _IE functions to get the form, then the form elements, etc. doesn't seem to work, so what I am asking is how I can get the form page to repopulate the $oIE (or maybe another internet explorer object)?

Thanks,

Jim

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By nooneclose
      Good morning, I am trying to figure out if it is possible to check if these invoice lines exist or not. 
      Here are the table and column name: INVOICELINE.INVOICELINENUM (a required field if created)
      Here is a picture of what I am talking about. (Do not worry about security. the picture is from a demo test site so all information is fake)
       
      is there any way to check if these fields exist or not? (they do not exist unless the user clicks on "New Row")
      Example: line 11 does not exist right now. How would I go about to see if it did or not? 
      This is what I have so far:
      SELECT DISTINCT iv.invoicenum, iv.description FROM invoice AS iv JOIN invoiceline AS ivl ON iv.invoicenum = ivl.invoicenum AND iv.siteid = ivl.siteid /* = 'nothing' and yet somehow not null? */ WHERE iv.invoicenum NOT IN (SELECT invoicelinenum FROM invoiceline WHERE invoicelinenum IS NOT NULL) I get 0 results where I should get more than 0. 
    • By Saravanan2213
      Hi everyone,
      i just need your help. i have script for cleaning browsing history and other unwanted file but the problem is i don't want to see the GUI i have attached below. It should not show anything on the screen. is it possible to do it in autoit. thanks in advance.
       
      So for i have tried flag
      Run("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", "", @SW_HIDE)
      @SW_DISABLE
       
      Looking forward your help.........

    • By cptHark
      Hello I want to conect to a Network with DriveMapAdd.
      This worked just fine but when you restart the Computer the Mapped drive is gone.
      So i used the persistent mapping flag and that seemed to work, too.
      However when the Computer is restarted I cant connect to the Network because it doesnt remember the Username and password I ave it the first time.
      How do I fix this?
      My Code:Func
      setdrivem()
          DriveMapAdd("M:", GUICtrlRead($driveM),1, GUICtrlRead($netzuser),GUICtrlRead($netzpassword) )
      EndFunc
      $netzuser and $netzpassword are set earlier in the gui and it works right after executing the script but i want it to stay connected
    • By nooneclose
      Morning, I am wondering is there is a way to prevent a script from ending/crashing when a "Subscript used on non-accessible variable" error occurs? 
      Here is some of my code:
      $aItems = _OL_ItemFind($oOutlook, $mFolder[1], $olMail, "[UnRead]=True", "Subject", "Maintenance Request", "EntryID,Subject", "", 0) If @error Then Sleep(2000) LoopUnreadEmails() ;Exit MsgBox(48, "", "@error = " & @error & ", @extended: " & @extended & " at line: " & @ScriptLineNumber) EndIf Error Msg:
      (371) : ==> Subscript used on non-accessible variable.: $aItems = _OL_ItemFind($oOutlook, $mFolder[1], $olMail, "[UnRead]=True", "Subject", "Maintenance Request", "EntryID,Subject", "", 0) $aItems = _OL_ItemFind($oOutlook, $mFolder^ ERROR I know that error occurs very rarely and at random. But like with most errors "in this case" I can use recursion to fix it. 
      I just recall the function and it will and has fixed itself. But this "Subscript used on non-accessible variable" just ends the script.
      Like I said before, is there a way to allow the script to keep running or call a function when this error occurs instead of just ending?   
    • By max23ed
      Hi,  i'm recording a setup for a program using mouse clicks , however, the problem is when the setup installs (the progress bar showing) the auto generated script by the recorder will not have a winwait() or sleep() to click the "finish" button when the setup is completed. is there anyway to  do that automatically?
×
×
  • Create New...