MRAJ Posted May 21, 2018 Author Share Posted May 21, 2018 I inspect the element and found the below in DOM explorer: <input onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" type="button" value="Clear Numbers"> and i sent you HTML page..as i am not able to find which is correct element and how to proceed. Please help. I have also sent you what i tried but it is not success. Link to comment Share on other sites More sharing options...
Juvigy Posted May 21, 2018 Share Posted May 21, 2018 You can try to execute the java function directly - "clearSIFields(formx, this, 'fieldsinumber', 12)" The other ways is to get all INPUT elements , loop truegh them and search for the .Value or innerhtml and execute the onclick event. Link to comment Share on other sites More sharing options...
MRAJ Posted May 21, 2018 Author Share Posted May 21, 2018 Can you help me with codes for these two ways to execute . Link to comment Share on other sites More sharing options...
Juvigy Posted May 22, 2018 Share Posted May 22, 2018 This is how you run a Javascript code: $oIE.Navigate2("javascript:console.log(123);void(0);") For the second part - you will have to use _IEFrameGetCollection first and get the correct frame the button is located in. Then you use the code from your first post. Link to comment Share on other sites More sharing options...
MRAJ Posted May 22, 2018 Author Share Posted May 22, 2018 This is the element for the button: <input onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" type="button" value="Clear Numbers"> and i am not seen any javascript code for this. Please help me with code to click on this. i have already provide my scripts what i done and HTML page for this. Below only frames i found ,but i have to click on clear number. Link to comment Share on other sites More sharing options...
Juvigy Posted May 23, 2018 Share Posted May 23, 2018 I told you - you need to use _IEFrameGetCollection before your code. Check it out , there is an example. You have 5 frames and need to get the correct frame first. For the Java - onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" this is the Java function that is called , but it will be complicated for you to use it. Go with the frames example. Link to comment Share on other sites More sharing options...
MRAJ Posted May 24, 2018 Author Share Posted May 24, 2018 (edited) That is the issue i am not able to find the desired elements. As i have already sent the frames info and HTML page of the button and also HTML full page: <input onclick="clearSIFields(formx, this, 'fieldsinumber', 12)" type="button" value="Clear Numbers"> I need element which will click on this button.As i tried with multiple times with different different elements. Edited May 24, 2018 by MRAJ Link to comment Share on other sites More sharing options...
Juvigy Posted May 25, 2018 Share Posted May 25, 2018 Post your code with the implementation of the frames code Link to comment Share on other sites More sharing options...
MRAJ Posted May 28, 2018 Author Share Posted May 28, 2018 Local $oIE = _IECreate($URL,0,1) Local $hWnd = WinWait("[CLASS:IEFrame]", "", 10) WinWaitActive($hWnd) Sleep(2000) ControlClick($hWnd, "Home - Internet Explorer", "[CLASS:IEFrame; INSTANCE:1]") Sleep(2000) $oButtons = _IETagnameGetCollection($oIE, "input") For $oButton in $oButtons If String($oButton.value) = "Clear Numbers" Then _IEAction($oButton, "click") ExitLoop EndIf Next This is the code which i tried but it is not working Link to comment Share on other sites More sharing options...
Juvigy Posted May 28, 2018 Share Posted May 28, 2018 And where in your code have you used _IEFrameGetCollection as i told you? This part you should delete : Local $hWnd = WinWait("[CLASS:IEFrame]", "", 10) WinWaitActive($hWnd) Sleep(2000) ControlClick($hWnd, "Home - Internet Explorer", "[CLASS:IEFrame; INSTANCE:1]") Sleep(2000) Link to comment Share on other sites More sharing options...
MRAJ Posted May 28, 2018 Author Share Posted May 28, 2018 I have already sent how many frames found but i dont know which frame to use and its code. Link to comment Share on other sites More sharing options...
Juvigy Posted May 29, 2018 Share Posted May 29, 2018 If you don't know which frame - loop trough each of them. Link to comment Share on other sites More sharing options...
MRAJ Posted May 29, 2018 Author Share Posted May 29, 2018 Could you please example for looping through each of the frame. Link to comment Share on other sites More sharing options...
Juvigy Posted May 29, 2018 Share Posted May 29, 2018 I told you before that there is an example in the help file. Why didn't you check it out? ; Open frameset example, get collection of frames ; and loop through them displaying their source URL's #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IE_Example("frameset") 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 Next MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt) _IEQuit($oIE) Link to comment Share on other sites More sharing options...
Earthshine Posted May 29, 2018 Share Posted May 29, 2018 (edited) Sorry mate, but you don't seem at all willing to look anything up, either in the help or on google or other search engines. This makes me very sad. The horse can be led to water but you cannot make him drink. I turned my kid, from failing into a straight A student. tons more too when I was tutoring mathematics (everything up to and including what I was taking) in college. that was my BEST job ever and MOST rewarding. to give someone the help they need to understand the material, and then watch them go from failing to As and Bs was so rewarding! Nothing else like it, let me tell you. However, we can't help you if you don't want to do any work and even read the stuff others have already pointed you to repeatedly. PS, the BEST feeling is when your student comes to you and says, I won't need your services anymore (because they were getting great grades--they would think they were hurting my feelings and I would tell them how happy I was instead). best 30 hour per week job ever. Edited May 29, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
MRAJ Posted May 31, 2018 Author Share Posted May 31, 2018 @Juvigy that example only i tried and sent the screenhot of the same in forum on 24th May. 5 frames found. Link to comment Share on other sites More sharing options...
MRAJ Posted May 31, 2018 Author Share Posted May 31, 2018 @Earthshine i do read and trying my level best to achieve but i am not able to find the solution. Its not like i am not reading the post and not trying. Hope you understand me. Link to comment Share on other sites More sharing options...
Juvigy Posted May 31, 2018 Share Posted May 31, 2018 You don't have to try only, you need to think also. For $i = 0 To ($iNumFrames - 1) $oFrame = _IEFrameGetCollection($oIE, $i) $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF Next Inside the above code you need to put your code from the first post. So that way for each frame found you need to try to get the button you want to click on as you dont know in which frame it is located! Earthshine 1 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