Jump to content

Recommended Posts

Posted (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 by rs007
Posted (edited)
 

I've already done that... therye is only 1 hit to this selector...

image.png.9bd8a26230a57eb5f489b1d5579808ef.png

 

 

Attached is the source code... line 640 contains what I described here

HTML-text.html

Edited by rs007

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...