Hi all,
The below is my javescript code, I am trying to do some automation,
I have successfully logging the site but after logging page I want to click another button called “View All”
I have used same code which I used to click logging button, but that code is not working to click view all button.
I have not understating why this code is not working thanks for advice me on same.
[code]
Moderator Note:![]()
div id="Fund_List" class="autoGrid" style="width=100%;"> <div id="aGrid" style="overflow=auto; width:100%; height:expression(document.body.clientHeight-120);" > <table width="100%" cellspacing="0" border="0"> <thead class="gridHeader"> <th align=left style="width:250px" class="ag_headerCell" id="ListHdr">Fund List Name</th> <th align=left style="width:250px" id="ListDescHdr" class="ag_headerCell" >Fund List Description</th> <th class="ag_headerCell"> </th> </thead> <tbody id="fundlist" valueSrc="FUND_ID" textSrc="FUND_ID" > </tbody> </table> </div> <div id="buttonDiv" style="overflow=auto; width=100%; height:90;" > <table width=100% class="ag_footer" cellspacing="7"> <tr align=left><td> <button onclick="addFundList()" style="cursor:hand;width:120px">Create Fund List</button> <button onclick="joinFundList()" style="cursor:hand;width:120px">Join Fund List</button> <button onclick="refreshFavScr()" style="cursor:hand;width:120px">View Favourites</button> <button onclick="refreshScr()" style="cursor:hand;width:120px">View All</button> <button onclick="searchLists()" style="cursor:hand;width:120px">Search Lists</button> </td></tr> <tr align=left><td> <button id="FASBfundElectn" onclick="viewFASBFundElection()" style="cursor: hand;width:120px">FASB Fund Election</button> <button id="FASBclientElectn" onclick="viewFASBClientElection()" style="cursor: hand;width:120px">FASB Client Election</button> <button id="config" onclick="viewConfiguration()" style="cursor: hand;width:120px">FASB Configuration</button> </td></tr> </table> </div> function refreshScr(){ mode="ALL"; for (var i=0;i<document.all.length;i++) { document.all[i].style.cursor='wait'; } var selectColl = document.getElementsByTagName("SELECT"); for (var i = 0, s; s = selectColl[i]; i++) { if (!s.disabled) { s.disabled = true; } } document.search.action="/ehorizon/fundlist-browse-all.do"; document.search.submit(); //window.location.reload(); [\code] Excel Vb code Sub ehorizonLogin() 'Dim IE As Object Dim doc As HTMLDocument Dim IE As InternetExplorer Set IE = New InternetExplorer Dim att As HTMLAttributeCollection Dim coll As HTMLElementCollection Dim ele As HTMLHtmlElement 'On Error GoTo Err_Clear IE.navigate "site" IE.Visible = True Set doc = IE.document Do ' Wait till the Browser is loaded Loop Until IE.readyState = READYSTATE_COMPLETE doc.getElementById("name").Value = "C501" doc.getElementById("id").Value = "A00000" doc.getElementById("passwd").Value = "XXXXX" doc.onclick = "loginValidate()" For Each ele In doc.getElementsByTagName("button") If ele.getAttribute("value") = ("LOGIN") Then ele.Click: End If Do ' Wait till the Browser is loaded Loop Until IE.readyState = READYSTATE_COMPLETE IE.Refresh Dim vele As HTMLHtmlElement Dim doc1 As HTMLDocument Set doc1 = IE.document For Each vele In doc.getElementsByTagName("button") If vele.getAttribute("value") = ("View All") Then vele.Click: End If Next Next 'Err_Clear: 'If Err <> 0 Then 'Debug.Assert Err = 0 'Err.Clear 'Resume Next 'End If End Sub
Pls use code tags around your code next time as per forum rules.











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks