PajeetLjama Posted June 27, 2018 Posted June 27, 2018 I would like to press the continue button on our administration page button code, the form "id" and name are randomly generated <form action="/administration/" method="post" name="2428" id="2428" onsubmit="solveJScap(); get('/administration/', '', this); disableSubmitButton(this); return false;"> <input class="button-maroon button-small" type="submit" value=" Continue "></p></form> ive tried this code, it works for other buttons but not this one Func clickobjbyclass(ByRef $oIE, $class) $tags = $oIE.document.GetElementsByTagName('input') For $tag In $tags $class = $tag.GetAttribute('class') If String($class) = $class Then Return _IEAction($tag, 'click') EndIf Next Return False EndFunc A spacebar and enter key controlclick also don't function furthermore ive tried _IEFormSubmit($oForm) but this also doesn't seem to trigger the continue button please help me out :- )
jdelaney Posted June 27, 2018 Posted June 27, 2018 (edited) Not sure how your function would ever return anything outside of a false positive...try this instead Func clickobjbyclass(ByRef $oIE, $sCallersClass) Local $tags = $oIE.document.GetElementsByTagName('input') For $tag In $tags Local $class = $tag.className() If String($class) = String($sCallersClass) Then Return _IEAction($tag, 'click') EndIf Next Return False EndFunc notice I'm NOT overwritting the variable being passed in. Also, check out the rules and etiquette of the forum before doing more 'bumps' Edited June 27, 2018 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
PajeetLjama Posted June 28, 2018 Author Posted June 28, 2018 15 hours ago, jdelaney said: Not sure how your function would ever return anything outside of a false positive...try this instead Func clickobjbyclass(ByRef $oIE, $sCallersClass) Local $tags = $oIE.document.GetElementsByTagName('input') For $tag In $tags Local $class = $tag.className() If String($class) = String($sCallersClass) Then Return _IEAction($tag, 'click') EndIf Next Return False EndFunc notice I'm NOT overwritting the variable being passed in. Also, check out the rules and etiquette of the forum before doing more 'bumps' that still doesn't click the input button in question
Danp2 Posted June 28, 2018 Posted June 28, 2018 43 minutes ago, PajeetLjama said: that still doesn't click the input button in question Doesn't click it (because it wasn't found) or just doesn't trigger an underlying event? There is a difference. Latest Webdriver UDF Release Webdriver Wiki FAQs
PajeetLjama Posted June 28, 2018 Author Posted June 28, 2018 7 minutes ago, Danp2 said: Doesn't click it (because it wasn't found) or just doesn't trigger an underlying event? There is a difference. it doesn't triggered an underlying event
Danp2 Posted June 28, 2018 Posted June 28, 2018 Probably could do it with jQuerify but difficult to provide further help without access to the site. Latest Webdriver UDF Release Webdriver Wiki FAQs
PajeetLjama Posted June 28, 2018 Author Posted June 28, 2018 1 minute ago, Danp2 said: Probably could do it with jQuerify but difficult to provide further help without access to the site. you can see the code the form uses in the post
Danp2 Posted June 28, 2018 Posted June 28, 2018 @PajeetLjama Yes, I know. However, I often solve these types of issues via trial and error, where I keep at it until I find a solution. Since only you have access to the site, that limits you to perform the testing to identify a working solution. Latest Webdriver UDF Release Webdriver Wiki FAQs
Juvigy Posted June 29, 2018 Posted June 29, 2018 Have you tried to execute the java code directly? "solveJScap(); get('/administration/', '', this); disableSubmitButton(this); return false;">
Moderators JLogan3o13 Posted June 29, 2018 Moderators Posted June 29, 2018 On 6/27/2018 at 5:25 PM, PajeetLjama said: bump On 6/27/2018 at 6:23 PM, PajeetLjama said: bumperino In the future, please do not bump your posts without waiting at least 24 hours. This may be the most important thing in the world to you, but you need to show some patience. Additionally, you could use that 24 hours to actually try new ways of solving the issue yourself, rather than simply waiting for someone to hand you code and then replying "it didn't work". "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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