Jump to content
Sign in to follow this  
sammy1983

Unable to access object in Frame

Recommended Posts

sammy1983

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.

Share this post


Link to post
Share on other sites
sammy1983

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)

Share this post


Link to post
Share on other sites
Danp2

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

Share this post


Link to post
Share on other sites
sammy1983

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

Share this post


Link to post
Share on other sites
sammy1983

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?

Share this post


Link to post
Share on other sites
sammy1983

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

Share this post


Link to post
Share on other sites
Danp2

 

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?

Share this post


Link to post
Share on other sites
sammy1983

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

 

Yes. 2 Frames but after a series of analysis, I found that the elements are placed on Floater which I am unable to access.

Share this post


Link to post
Share on other sites
Danp2

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

Share this post


Link to post
Share on other sites
sammy1983

 

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!

Share this post


Link to post
Share on other sites
sammy1983

 

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.

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
Sign in to follow this  

×