rs007 Posted Sunday at 05:44 PM Posted Sunday at 05:44 PM (edited) I have a problem where I can't get any further. It changed the site that I automated with Webdriver for Firefox. This is from the site BEFORE it was changed. I found this on my PC: <input class="continue_submit" id="formsubmit" type="submit" value="Weiter"> ... everything has worked so far. Ultimately it's just a 'click' on a button called 'Continue' This is how it was solved: i_ClickElement("//input[@id='formsubmit']" Func i_ClickElement($sSelector, $sMessage = '') i_WaitFor($sSelector) _WD_ElementAction($sSession, i_FindElement($sSelector, $sMessage), 'click') EndFunc Func i_WaitFor($sSelector) Local Const $iTimeoutInMilliseconds = 2000 Local Const $iElementVisibleFlag = 1 _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, $sSelector, 2000, $iTimeoutInMilliseconds, $iElementVisibleFlag) EndFunc Func i_FindElement($sSelector, $sMessage = '') Local $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sSelector) If @error <> $_WD_ERROR_Success Then ConsoleWrite($sMessage & ' ==> Error for XPath selector ''' & $sSelector & '''.' & @CRLF) _WD_DeleteSession($sSession) _WD_Shutdown() Exit EndIf Return $sElement EndFunc ...everything's great...everything's good! Now the site has been changed and it no longer works... This is from the site AFTER it was changed: <input class="continue_submit" id="formsubmit" accesskey="z" value="Weiter" type="submit" tabindex="2"> ... and it doesn't work anymore. Unfortunately the output does not provide an error message!! The result from the Webdriver window is: _WD_ElementAction ==> Success [0] : Parameters: Command=click Option=Default _WD_WaitElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[@id='formsubmit'] Delay=750 Timeout=1200 Options=1 __WD_Post ==> Success [0] : HTTP status = 200 _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[@id='formsubmit'] StartNodeID=Default Multiple=Default ShadowRoot=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_ElementAction ==> Success [0] : Parameters: Command=click Option=Default What's missing here is this line: __WD_Post ==> Success [0] : HTTP status = 200 ... the website gives me an error message: "Action not possible." How does the selector have to be defined so that it works again? Info... if I click through the website manually, the 'click' on the <Continue> button is accepted and the website works as usual... i.e. without an error message. and: unfortunately this doesn't work either... I get the same error message _WD_Action($sSession, 'actions', '{"actions": [{"type": "key", "id": "keyboard", "actions": [{"type": "keyDown", "value": "\uE006"}, {"type": "keyUp", "value": "\uE006"}]}]}') _WD_Action($sSession, 'actions', '{"actions": [{"type": "key", "id": "keyboard", "actions": [{"type": "keyDown", "value": "\uE007"}, {"type": "keyUp", "value": "\uE007"}]}]}') Edited Sunday at 05:47 PM by rs007
Danp2 Posted Sunday at 06:34 PM Posted Sunday at 06:34 PM It's likely that there are more than one elements matching your selector. First step is to confirm that is true. Then adjust your selector so that the correct one is found. Latest Webdriver UDF Release Webdriver Wiki FAQs
rs007 Posted Sunday at 06:48 PM Author Posted Sunday at 06:48 PM (edited) I've already done that... therye is only 1 hit to this selector... Attached is the source code... line 640 contains what I described here HTML-text.html Edited Sunday at 06:49 PM by rs007
Danp2 Posted Sunday at 10:51 PM Posted Sunday at 10:51 PM I can see some definite issues with the "wrapper" functions that you wrote. Beyond that, you should review the forum rules regarding gaming. Latest Webdriver UDF Release Webdriver Wiki FAQs
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