From 88c48e133e26358a2d98cc8f60cba13aaa9b8ad5 Mon Sep 17 00:00:00 2001 From: Yuriy Date: Thu, 2 May 2024 00:29:11 -0400 Subject: [PATCH] expanded function --- Selenium-Functions.ahk | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Selenium-Functions.ahk b/Selenium-Functions.ahk index b62ffb7..fad4ac9 100644 --- a/Selenium-Functions.ahk +++ b/Selenium-Functions.ahk @@ -720,8 +720,20 @@ Selenium_LoopToSendValueByName(ElementName,NumOfLoops:=1,SleepLength:=1000,Strin } } -Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:=""){ +Selenium_LoopToSendValueToXpath(Xpath,NumOfLoops:=1,SleepLength:=1000,StringTextContent:="",ClearElement:=0){ + ; Msgbox % "StringTextContent: " StringTextContent +; Msgbox % "ClearElement: " ClearElement + loop, %NumOfLoops% { + ; msgbox % ClearElement + if(ClearElement){ + Loop, 3 { ; have to do it multiple times to make it trigger properly + driver.FindElementByXPath(Xpath).clear() + sleep, 500 + } + } + + ; ToolTip, Loop attempt: %A_index% try driver.FindElementByXPath(Xpath).sendKeys(StringTextContent) ; Click on "upload image" button catch e {