Jump to content

Unable to access object in Frame


Go to solution Solved by sammy1983,

Recommended Posts

Hi,

I have a page where a drop down menu and a text box are placed on a frame.

Below is the source code:

<form action="URL" name="customerMgmt" method="post" class="form1" >
        <fieldset class="form1bg">
            <input name="userName" type="hidden" value="1225400" />
            Are you sure you want to suspend customer: Username?
            Suspending the user will block the user login, suspend payment accounts and cancel all scheduled payments.
            <div class="vspace2"></div>
            <input type="hidden" name="action" value="suspend" />
           <dl>
                <dt> 
                    <span class="mandatory">*</span><label for="suspensionReasonCode">
                    <b>Choose Reason Code:</label></b>
                </dt>
                <dd>
                    <select class="valign_middle" name="suspensionReasonCode"  id="suspensionReasonCode" style="width:250px" title="Select the Reason Code" onChange="javascript:return showSuspMandatoryComments();">
                        <option value="0" selected>Reason Code</option>
                        
                            <option value="4">Admin - Administrative Return Problem</option>
                        
                            <option value="5">CB - Cobrand Request</option>
                        
                            <option value="1">NSF - Excessive NSFs</option>
                        
                            <option value="16">OFAC - Payee Match</option>
                        
                            <option value="15">OFAC - Payor Match</option>
                        
                            <option value="6">Other</option>
                        
                            <option value="3">Risk - Risk Exposure</option>
                        
                            <option value="2">SA - Suspicious Activity</option>
                        
                    </select>
                    <div class="error" id="err.summary.suspensionReasonCode.notselected"> </div>
                </dd>
            </dl>  
            <dl>
                <dt><span id="required" class="hide">*</span>Comments:</dt>
                <dd>
                    <textarea cols="75" rows="6" id="suspensionComment" name="suspensionComment"
                            onkeyup="isExceedMaxLetters('suspensionComment','msgName',200);"></textarea>
                    <div class="caption">
                        <div id="msgName">200&nbsp;characters remaining</div>
                    </div>
                    <div class="error" id="err.suspensionComment"> </div>
                </dd>
            </dl>      
        </fieldset>
        <div class="float_table">
            <span class="floatright">
                
                
                <input type="hidden" name="targetUrl" value="URL" />
                <input type="hidden" name="redirect" value="true" />
                <input id="submitButton" type="submit" class="btn" title="Suspend" value="Suspend" onClick="javascript:return validateSuspension();" />
            </span>
        </div>
    <input type='hidden' name='c' value='csit_key_0:Q319py+uhspwSE5zABS7Ow0/1Ag='/><input type='hidden' name='l' value='u:s'/><input type='hidden' name='cobrandIdentifier' value='10005668'/></form>

Here is my code:

Local $oFrames = _IEFrameGetCollection($oIE)
$Fname = $oFrames.name
ConsoleWrite("Frame Name is :" & $Fname & @CRLF)
$oFrame = _IEFrameGetObjByName($oIE, $Fname)
$oInput1 = _IEGetObjByName($oFrame, "suspensionReasonCode")

For some reason, I am not able to access the drop-down menu with the name "suspensionReasonCode" and receiving below output from Console

Frame Name is :0
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: suspensionReasonCode, Index: 0)

Can someone enlighten please? Thanks.

Link to comment
Share on other sites

Hi,

I have a page where a drop down menu and a text box are placed on a frame.

Below is the source code:

<form action="URL" name="customerMgmt" method="post" class="form1" >
        <fieldset class="form1bg">
            <input name="userName" type="hidden" value="1225400" />
            Are you sure you want to suspend customer: Username?
            Suspending the user will block the user login, suspend payment accounts and cancel all scheduled payments.
            <div class="vspace2"></div>
            <input type="hidden" name="action" value="suspend" />
           <dl>
                <dt> 
                    <span class="mandatory">*</span><label for="suspensionReasonCode">
                    <b>Choose Reason Code:</label></b>
                </dt>
                <dd>
                    <select class="valign_middle" name="suspensionReasonCode"  id="suspensionReasonCode" style="width:250px" title="Select the Reason Code" onChange="javascript:return showSuspMandatoryComments();">
                        <option value="0" selected>Reason Code</option>
                        
                            <option value="4">Admin - Administrative Return Problem</option>
                        
                            <option value="5">CB - Cobrand Request</option>
                        
                            <option value="1">NSF - Excessive NSFs</option>
                        
                            <option value="16">OFAC - Payee Match</option>
                        
                            <option value="15">OFAC - Payor Match</option>
                        
                            <option value="6">Other</option>
                        
                            <option value="3">Risk - Risk Exposure</option>
                        
                            <option value="2">SA - Suspicious Activity</option>
                        
                    </select>
                    <div class="error" id="err.summary.suspensionReasonCode.notselected"> </div>
                </dd>
            </dl>  
            <dl>
                <dt><span id="required" class="hide">*</span>Comments:</dt>
                <dd>
                    <textarea cols="75" rows="6" id="suspensionComment" name="suspensionComment"
                            onkeyup="isExceedMaxLetters('suspensionComment','msgName',200);"></textarea>
                    <div class="caption">
                        <div id="msgName">200&nbsp;characters remaining</div>
                    </div>
                    <div class="error" id="err.suspensionComment"> </div>
                </dd>
            </dl>      
        </fieldset>
        <div class="float_table">
            <span class="floatright">
                
                
                <input type="hidden" name="targetUrl" value="URL" />
                <input type="hidden" name="redirect" value="true" />
                <input id="submitButton" type="submit" class="btn" title="Suspend" value="Suspend" onClick="javascript:return validateSuspension();" />
            </span>
        </div>
    <input type='hidden' name='c' value='csit_key_0:Q319py+uhspwSE5zABS7Ow0/1Ag='/><input type='hidden' name='l' value='u:s'/><input type='hidden' name='cobrandIdentifier' value='10005668'/></form>

Here is my code:

Local $oFrames = _IEFrameGetCollection($oIE)
$Fname = $oFrames.name
ConsoleWrite("Frame Name is :" & $Fname & @CRLF)
$oFrame = _IEFrameGetObjByName($oIE, $Fname)
$oInput1 = _IEGetObjByName($oFrame, "suspensionReasonCode")

For some reason, I am not able to access the drop-down menu with the name "suspensionReasonCode" and receiving below output from Console

Frame Name is :0
--> IE.au3 T3.0-1 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: suspensionReasonCode, Index: 0)

Can someone enlighten please? Thanks.

 

Even tried below:

Local $oFrames = _IEFrameGetCollection($oIE)
$Fname = $oFrames.name
ConsoleWrite("Frame Name is :" & $Fname & @CRLF)
$oFrame = _IEFrameGetObjByName($oIE, $Fname)
$oInput1 = _IEGetObjByID($oFrame, "suspensionReasonCode")

Output is:

Frame Name is :0
--> IE.au3 T3.0-1 Warning from function _IEGetObjById, $_IEStatus_NoMatch (suspensionReasonCode)
Link to comment
Share on other sites

By default, _IEFrameGetCollection will return a collection of frames. Suggest that you look at the help file example and adapt your code from there.

 

I tried this:

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
    $Fname = $oFrames.name
    MsgBox(0,"",$Fname)
    ConsoleWrite("Frame Name is :" & $Fname & @CRLF)
Next

Output is:

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
Frame Name is :0
Frame Name is :0
Link to comment
Share on other sites

Ok, so using the Debugbar, I found that it is a DIV.floaterLayout on which the elements are placed and though the elements have Name and ID, I am unable to access them, probably bcoz of this floater Layout. Any idea how to crack this Floater?

Link to comment
Share on other sites

Ok, so using the Debugbar, I found that it is a DIV.floaterLayout on which the elements are placed and though the elements have Name and ID, I am unable to access them, probably bcoz of this floater Layout. Any idea how to crack this Floater?

 

It is a floater DIV

Link to comment
Share on other sites

 

I tried this:

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
    $Fname = $oFrames.name
    MsgBox(0,"",$Fname)
    ConsoleWrite("Frame Name is :" & $Fname & @CRLF)
Next

Output is:

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
Frame Name is :0
Frame Name is :0

 

You didn't post the complete output. How may frames were found? 2?

Link to comment
Share on other sites

That's probably because it is located within one of the frames. :ermm:

Going back to your initial post, what output do you get from the following code?

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $oFrame = 0

For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)

    $oInput1 = _IEGetObjByID($oFrame, "suspensionReasonCode")

    If @error Then
        ConsoleWrite("Frame number " & $i & ": Object not found! "& @CRLF)
    Else
        ConsoleWrite("Frame number " & $i & ": Object found! "& @CRLF)
    EndIf
Next
Link to comment
Share on other sites

 

That's probably because it is located within one of the frames. :ermm:

Going back to your initial post, what output do you get from the following code?

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $oFrame = 0

For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)

    $oInput1 = _IEGetObjByID($oFrame, "suspensionReasonCode")

    If @error Then
        ConsoleWrite("Frame number " & $i & ": Object not found! "& @CRLF)
    Else
        ConsoleWrite("Frame number " & $i & ": Object found! "& @CRLF)
    EndIf
Next

 

Output is:

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-1 Warning from function _IEGetObjById, $_IEStatus_NoMatch (suspensionReasonCode)
Frame number 0: Object not found! 
Frame number 1: Object found!
Link to comment
Share on other sites

  • Solution

 

Ok... so then the following should address the original issue:

$oFrame = _IEFrameGetCollection($oIE, 1)
$oInput1 = _IEGetObjByName($oFrame, "suspensionReasonCode")

 

Oh man!!! You are definitely a Genius. After Melba and John, you are in my "Most Admired" list. No words to thank but truly you have saved me out of a big trouble. A new learning as well.  :guitar: ..Thanks again.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...