mianz Posted August 19, 2008 Share Posted August 19, 2008 <TR> <TD align=CENTER WIDTH="50%"> <input type="button" value="I Agree" class="btn" onmouseover="blueBtnOver(this)" onmouseout="blueBtnOut(this)" onclick="java script:location.href='b-3c-SelectPracticalTestBooking.asp?+3'"/> </TD> <TD align=CENTER WIDTH="50%"> <input type="button" value="Disagree" class="btn" onmouseover="blueBtnOver(this)" onmouseout="blueBtnOut(this)" onclick="java script:location.href='b-default.asp'"/> </TD> </TR> This is all i'm given. i have obsolutely no idea how to click on that button. i do not wish to use coordinates. Can any professional please help me. thanks a millon. Link to comment Share on other sites More sharing options...
Spiff59 Posted August 19, 2008 Share Posted August 19, 2008 <TR> <TD align=CENTER WIDTH="50%"> <input type="button" value="I Agree" class="btn" onmouseover="blueBtnOver(this)" onmouseout="blueBtnOut(this)" onclick="java script:location.href='b-3c-SelectPracticalTestBooking.asp?+3'"/> </TD> <TD align=CENTER WIDTH="50%"> <input type="button" value="Disagree" class="btn" onmouseover="blueBtnOver(this)" onmouseout="blueBtnOut(this)" onclick="java script:location.href='b-default.asp'"/> </TD> </TR>This is all i'm given. i have obsolutely no idea how to click on that button. i do not wish to use coordinates. Can any professional please help me. thanks a millon.You might find looking in the help file for _IEAction or _IEFormSubmit to be useful. Link to comment Share on other sites More sharing options...
mianz Posted August 19, 2008 Author Share Posted August 19, 2008 sorry. from what i see in the help file. it only shows how it work with buttons with name and form name, without this two unique names, i couldnt locate this button anywhere. Link to comment Share on other sites More sharing options...
Spiff59 Posted August 19, 2008 Share Posted August 19, 2008 Oops! Pardon, I see your point. Other than using unreliable coordinates the only thing I can think of would be the brute-force approach of sending keystrokes to the window, like: Send("{TAB}{TAB}{TAB}{ENTER}") Maybe a true guru knows of a better method. Link to comment Share on other sites More sharing options...
DaleHohm Posted August 19, 2008 Share Posted August 19, 2008 In addition, you may need _IEFormElementGetCollection or _IETagnameGetCollection There are lots of ways to do this... here is one: $oInputs = _IETagnameGetCollection($oIE, "input") For $oInput in $oInputs If $oInput.type = "button" and String($oInput.value) = "I Agree" Then _IEAction($oInput, "click") Next Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
mianz Posted August 20, 2008 Author Share Posted August 20, 2008 dale... i love you so much. you are insanely godlike. Link to comment Share on other sites More sharing options...
mianz Posted August 20, 2008 Author Share Posted August 20, 2008 After i click on a submit button, there comes a popup asking me for a OK or Cancel click. i tried this command. WinWait("Windows Internet Explorer") ControlClick("Windows Internet Explorer", "", "[CLASS:Button; Instance:1;]") <--- last line It didnt work. funny thing is after i manually click cancel, the script is still running at this moment. then i try to click a logoff link, which also prompt the same popup box, now it automaticly click cancel for me, and the script would end. why is this so? Link to comment Share on other sites More sharing options...
mianz Posted August 20, 2008 Author Share Posted August 20, 2008 i found out why already. WinWait("Windows Internet Explorer") ControlClick("Windows Internet Explorer", "", "[CLASS:Button; Instance:1;]") this command actually works, is due to the previous command _IEFormSubmit ($oForm2) i have change to _IEAction ($oSubmit2, "click") now it works fine? i'm surpise. why is that so too. Link to comment Share on other sites More sharing options...
DaleHohm Posted August 20, 2008 Share Posted August 20, 2008 I'm not certain I am understanding completely your problem. One thing that can happen is that clicking on a button can cause a Javascript alert box or message window to appear. If this happens, your script is likely to pause until the message box is dismissed... this prevents your program from dismissing it because it does not have control. If this is happening to you, you can use the technique in Example 2 for _IEAction in the helpfile Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
mianz Posted August 22, 2008 Author Share Posted August 22, 2008 i'm just surpise why _IEFormSubmit ($oForm2) didn't work and _IEAction ($oSubmit2, "click") would work. is there anyway that i can select on this radio button which do not have a form name, and i wan to select it via searching for this value only ---> 18/10/2008 the radio button value is random, so i couldt use that. <td id='cell58_1' class='txtbold' align='center' bgcolor='white' onmouseover='doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' onmouseout="hideTip();"><input type="radio" id="58_1" name="slot" value="142233"></td> Link to comment Share on other sites More sharing options...
maxlarue Posted August 22, 2008 Share Posted August 22, 2008 <td id='cell58_1' class='txtbold' align='center' bgcolor='white' onmouseover='doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' onmouseout="hideTip();"> <input type="radio" id="58_1" name="slot" value="142233"></td> $elements = $ie.document.getElementsByTagName("input") For $element in $elements If $element.previousSibling.getAttribute("onmouseover") = "'doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' Then $element.Click() endif Next or maybe like this ... If $element.parentNode.firstChild.getAttribute("onmouseover") = "'doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' Then ... do something like that, i can't be sure because i don't know what the page looks like once you get away from the ie.au3 functions you open yourself up to alot of flexibility for navigating the DOM Link to comment Share on other sites More sharing options...
mianz Posted August 22, 2008 Author Share Posted August 22, 2008 If $element.previousSibling.getAttribute("onmouseover") = "'doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");'" Then If $element.previousSibling.getAttribute("onmouseover") = "'doTooltip(event,0, "18/10/2008 (Sat^ ERROR isnt the previoussibling this ----> onmouseout="hideTip();" sorry i'm confused Link to comment Share on other sites More sharing options...
maxlarue Posted August 22, 2008 Share Posted August 22, 2008 you'll need to use escape characters so that the whole thing becomes a string, right now it thinks its code somenode.previousSibling returns the DOM node which is 1 above the given node... so suppose i have like this <div images> <img1.... <img2... <img3... </div> then img2.parentNode is going to be the div, and img2.previousSibling is going to be img1, while img2. nextSibling is going to be img3 Link to comment Share on other sites More sharing options...
mianz Posted August 22, 2008 Author Share Posted August 22, 2008 <tr bgcolor='#FFFFFF'><td class='txtbold' align='center'>18/10/2008<BR>Sat</td><td></td><td id='cell58_1' class='txtbold' align='center' bgcolor='white' onmouseover='doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' onmouseout="hideTip();"><input type="radio" id="58_1" name="slot" value="142233"></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> this is the full line of codes. does it help? sorry for needing a spoon feed. got really no idea. Link to comment Share on other sites More sharing options...
maxlarue Posted August 22, 2008 Share Posted August 22, 2008 <tr bgcolor='#FFFFFF'> <td class='txtbold' align='center'>18/10/2008<BR>Sat</td> <td></td> <td id='cell58_1' class='txtbold' align='center' bgcolor='white' onmouseover='doTooltip(event,0, "18/10/2008 (Sat)","2","09:15","09:45");' onmouseout="hideTip();"><input type="radio" id="58_1" name="slot" value="142233"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> can be found by taking an approach like this $elements = $ie.document.getElementsByTagName("td") for $element in $elements if $element.outerText = "18/10/2008" then $element.nextSibling.nextSibling.Click() endif Next or if it will always have the id=58_1 then you can do $ie.document.getElementById("cell58_1").Click() not 100% sure about the click command, but finding the object is the hard part Link to comment Share on other sites More sharing options...
DigitalIsBetter Posted August 26, 2008 Share Posted August 26, 2008 Ty for this post helped out alot thanks. 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