Jump to content

Recommended Posts

Posted

Hi. I can not automate the click at a button, because there are three of them exactly in the source page.

Imagine you have this html source code:

<div class="submit"><span class="button btnDefault"><span><input type="submit" value="Search" /></span></span></div>

How could I select just one element, and do click as an action on it?

$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']")

_WD_ElementAction($sSession, $sElement, 'click')

That just do not work.

Any ideas?

submits.PNG

Posted

You can get an array of submit elements then access to correct one in the array.

 

Saludos

Posted
31 minutes ago, Danyfirex said:

You can get an array of submit elements then access to correct one in the array.

 

Saludos

Gracias Danyfirex, I think I understand what you mean but I do not know how to code it

I have tried to do this:

Local $aVar[3]
    _ArrayAdd ($aVar,_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']"))
    _ArrayAdd ($aVar,_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']"))
    _ArrayAdd ($aVar,_WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']"))

    MsgBox($MB_SYSTEMMODAL, "FINaaa", $aVar[2] )
    _WD_ElementAction($sSession, $aVar[2], 'click')

but with out result.

Posted

I meant this:

Local $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']","",True)
_ArrayDisplay($aElements)

Saludos

Posted
14 minutes ago, Danyfirex said:

I meant this:

Local $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']","",True)
_ArrayDisplay($aElements)

Saludos

Sounds good! Let see if I can use it...

array.PNG

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
×
×
  • Create New...