Paranthaman

IE Frames problem - Not able to click a link

7 posts in this topic

#1 ·  Posted (edited)

Hello,

I'm trying to manipulate IE but the webapplication is using frames. All frames are using JS  and Autoit doesn't seem to find any of the frames.

have seen there is a bunch of similar topics, but for some reason (probably because I´m really a beginner with AutoIt and do not have other programming experience) what I have seen there didn´t really help me.

 

<frameset class="level1" rows="95,*" border="0" frameborder="0" framespacing="0" id="bco-level1-frameset">

<frame src="topbar.jsp?liferaypageid=&amp;bcoCommunityId=&amp;defaultsection=APPLVIEW&amp;actionid=" name="topbar" scrolling="no" noresize="noresize">
<frameset class="level2" frameborder="1" framespacing="1" border="4" cols="220,*">
<frame src="sidebar.jsp" name="menu" scrolling="no">
<frame src="" name="main" scrolling="auto">
</frameset>
</frameset>

 

The link which i want to click is within frame name= main. In <frame src="" name="main" scrolling="auto"> am having the following tags

<div class="actionItemDesc button ">                        
<div class="size16X16">
<a title="" class="treeurl voidfunc" href="javascript:voidFunc();">
<span class="size16X16 iconContainer tagtype" style="background-color:#000099">
</span>
</a> 
</div>  
<span class="actionLinks ">
<a class="actionItemName" href="/production.html" title="">Production,</a>
</span><!--[if IE]> <![endif]--> 
</div>

 

The link which i try to click is <a class="actionItemName" href="/production.html" title="">Production,</a>.

 

 

Can anyone help?

 

 

 

Edited by Paranthaman

Share this post


Link to post
Share on other sites



I don't see your code. What have you tried?

Share this post


Link to post
Share on other sites

@Juvigy The code which i had written doesn't seems to work and so I thought if I post that, it will be confusing for others too. 

But still,will add that here

Local $oIE = _IECreate("capserver.root.net:8000/console/analyse")           ;Opened the website

;Collected all frames
Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended                    ;Total no of frames available
Local $oFrame = 0
$i = 3                                           ;To select iframe name="main which is 4th in order
$oFrame = _IEFrameGetCollection($oIE, $i)        ;Fecth all properties from iframe no4
$sTxt2 = _IEPropertyGet($oFrame, "locationurl")  ;Fetch the iframe no4's url and store in sTxt2



Local $oIE2 = _IECreate($sTxt2)                   ;Open the iframe no4 url
Local $sMyString = "Production,"                  ;"String to Search and open the link which has this as text
Local $oLinks = _IELinkGetCollection($oIE2)       ;Returns all link in the document
For $oLink In $oLinks                             ;Searches for all links and click that one with text "Production,"
    Local $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next

 

1.It's not running and i can't figure out the reason

2. Also if it run's , when I fetch that Iframe link and open it again at line " Local $oIE2 = _IECreate($sTxt2) " the page gets expired .So is there any function to read the link inside iframe ,without opening it in a seperate window. pls guide me how I need to proceed

Share this post


Link to post
Share on other sites

Don't open the frame in a new window. Instead, use the frame object as the parameter for _IELinkGetCollection, ie --

Local $oLinks = _IELinkGetCollection($oFrame)

 

Share this post


Link to post
Share on other sites
On 2/3/2017 at 8:06 PM, Danp2 said:

Don't open the frame in a new window. Instead, use the frame object as the parameter for _IELinkGetCollection, ie --

Local $oLinks = _IELinkGetCollection($oFrame)

 

Thanks for helping out. but I tried that too, instead of redirecting to  " https:capserver.root.net:8000/console/analyse/freesearch.do?operation=search&searchtext=tag%3AProduction" it is redirecting to "I:\console\analyze\freesearch.do"

Any help?

Share this post


Link to post
Share on other sites

Not really. It should work if you run the code as discussed. The only reason that I can think that it would redirect to "I:" is if you are running different code than shown here (ie: your saving the source to the I: drive and then reloading it in IE from there).

Share this post


Link to post
Share on other sites

Are you sure that you are getting the correct frame?  Try something like this:
 

$oIE = _IECreate("capserver.root.net:8000/console/analyse") 
    $oFrames = _IEFrameGetCollection ($oIE)
    $iNumFrames = @extended
        For $i = 0 to ($iNumFrames - 1)
            $oFrame = _IEFrameGetCollection ($oIE, $i)
            ConsoleWrite( $oFrame.name &@CRLF)
        next

 

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