|
|
|
@ -41,12 +41,22 @@ if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
|
|
|
|
Message = Inputting Post Content
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
Xpath = //input[@id='title']
|
|
|
|
|
try driver.FindElementByXPath(Xpath).click()
|
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle)
|
|
|
|
|
if(Status){
|
|
|
|
|
Message = Failed to input Title
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
Return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Xpath = //*[@id="body"]
|
|
|
|
|
try driver.FindElementByXPath(Xpath).click()
|
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
|
|
|
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostBody)
|
|
|
|
|
if(Status){
|
|
|
|
|
Message = Failed to input Title
|
|
|
|
|
Message = Failed to input Body
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
Return
|
|
|
|
@ -79,39 +89,22 @@ if(ImageAttachmentFilepath != ""){
|
|
|
|
|
Message = Submitting Post
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
; Click Publish post
|
|
|
|
|
js = document.getElementsByName('submitPost')[0].click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
|
|
|
|
|
try driver.executeScript(js)
|
|
|
|
|
|
|
|
|
|
Message = Double checking that post got submitted
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
sleep, 5000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ; Click the final "post" button
|
|
|
|
|
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
Status := Selenium_LoopToClickName(ElementName:="submitPost",NumOfLoops:=5,SleepLength:=1000)
|
|
|
|
|
if(Status){
|
|
|
|
|
Message = Failed to Submit Post
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
Return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
; msgbox
|
|
|
|
|
|
|
|
|
|
; @todo: add error check into here to check the current page url and after page url
|
|
|
|
|
; Click Publish post
|
|
|
|
|
js = document.getElementsByName('submitPost')[0].click(); ; Send content through javascript (Great for getting around emoji chrome limitaitons)
|
|
|
|
|
try driver.executeScript(js)
|
|
|
|
|
|
|
|
|
|
Message = Double checking that post got submitted
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
|
|
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
|
sleep, 5000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try CurrentTabURL := driver.Url
|
|
|
|
|
if(InStr(CurrentTabURL, "share/post")) { ; post failed to submit if it's still on the create new post page
|
|
|
|
|
Message = Error: Post Was Input but Failed to Submit.
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
Return
|
|
|
|
|
try CurrentTabURL := driver.Url
|
|
|
|
|
if(InStr(CurrentTabURL, "share/post")) { ; post failed to submit if it's still on the create new post page
|
|
|
|
|
Message = Error: Post Was Input but Failed to Submit.
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
|
SaveDriverURLOFErrorPage()
|
|
|
|
|
Return
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|