ademon Posted September 24, 2018 Posted September 24, 2018 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?
Danyfirex Posted September 24, 2018 Posted September 24, 2018 You can get an array of submit elements then access to correct one in the array. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
ademon Posted September 24, 2018 Author Posted September 24, 2018 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.
Danyfirex Posted September 24, 2018 Posted September 24, 2018 I meant this: Local $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit'][@value='Search']","",True) _ArrayDisplay($aElements) Saludos SkysLastChance 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
ademon Posted September 24, 2018 Author Posted September 24, 2018 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...
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