LurchMan Posted September 13, 2010 Share Posted September 13, 2010 Hey everyone - I'm working on automating a website and I can't get it to click this link: <td class="primaryNav" width="*" nowrap="nowrap" id="antiSpam"> <a href="policy/spam/viewSpamPolicy.do" onclick="selectPrimaryNavLink('antiSpam')"> I've tried using _IECLinkClickByText (), _IECLinkClickByID () and _IEGetObjByID () with _IEAction (). When I use _IEGetObjByID () it successfully gets the Obj but it doesn't click it. Neither function is reporting an error either. Any help will be greatly appreciated! Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
notsure Posted September 13, 2010 Share Posted September 13, 2010 (edited) _IENavigate($oIE, "javascript:selectPrimaryNavLink('antiSpam')", 0); ? Edited September 13, 2010 by notsure Link to comment Share on other sites More sharing options...
Juvigy Posted September 13, 2010 Share Posted September 13, 2010 Are you sure it gets the correct object? There maybe more objects with the same ID. it is possible there are frames too. Did you try _IELinkGetCollection and loop them with Consolewrite($element.innerhtml&@crlf) + counter to see which elemnt you need? Link to comment Share on other sites More sharing options...
LurchMan Posted September 13, 2010 Author Share Posted September 13, 2010 Thank you for the reply - I did not know you could run java script like that with he _IE functions. Although this did not do it either - it showed the link has focus but does not go to the page. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
LurchMan Posted September 13, 2010 Author Share Posted September 13, 2010 Are you sure it gets the correct object? There maybe more objects with the same ID.it is possible there are frames too. Did you try _IELinkGetCollection and loop themwith Consolewrite($element.innerhtml&@crlf) + counter to see which elemnt you need?I've looked through the source of the web page and I didn't see another object with the same ID...However my tired brain looked over this idea, and using the _IELinkClickByIndex with the index i got from your suggestion worked...Thank you for your help. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Juvigy Posted September 13, 2010 Share Posted September 13, 2010 Glad i could help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now