reworked Minds check for submit success/fail

main
Yuriy 1 year ago
parent 600481a517
commit e67b80a2d8

@ -194,30 +194,32 @@ loop, 3 {
} }
; msgbox, ork?
; click submit button Loop, 5 {
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click(); if(A_index = 5){
try status := driver.executeScript(js) Message = Failed to submit after 5 attempts.
catch e {
Message = Clicking submit button with JS resulted in status: %status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Message = Trying to click the Post button using Xpath
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
Xpath = (//span[@class='ng-star-inserted'][normalize-space()='Post'])[2]
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
if(Status){
Message = Failed to Submit Post after 2 different attempts
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveDriverURLOFErrorPage() SaveDriverURLOFErrorPage()
Return Return
}
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click();
try status := driver.executeScript(js)
sleep, 500
; check if Post button still exists
js = return document.querySelector("m-composer__base[ismodal='true'] m-button[data-ref='post-button'] div").innerText
try, Status := driver.executeScript(js) ;Executes a Javascript on the webpage, mostly used for buttons.
if(!Status){
; msgbox, successfully submitted after %A_index% attempts
break
} }
}
sleep, 1000
}
SaveOrPostProgress(Message:="Waiting 5 seconds to confirm post got submitted",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") SaveOrPostProgress(Message:="Waiting 5 seconds to confirm post got submitted",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")

Loading…
Cancel
Save