Added a couple more error checks to Chrome Tab switching function
This commit is contained in:
@@ -40,7 +40,7 @@ global UpdateVersionNumber
|
|||||||
|
|
||||||
|
|
||||||
ScriptName = Freedomain Social Media Poster
|
ScriptName = Freedomain Social Media Poster
|
||||||
ScriptVersion = 2.75
|
ScriptVersion = 2.76
|
||||||
FullScriptName := ScriptName . " " . ScriptVersion
|
FullScriptName := ScriptName . " " . ScriptVersion
|
||||||
|
|
||||||
;---ToDo---
|
;---ToDo---
|
||||||
@@ -1561,6 +1561,8 @@ Return
|
|||||||
;---------------/Facebook----------------------------------
|
;---------------/Facebook----------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
; -------------------------------Parler-------------------------------
|
; -------------------------------Parler-------------------------------
|
||||||
PostToParler:
|
PostToParler:
|
||||||
@@ -1887,178 +1889,179 @@ if(ImageAttachmentFilepath != ""){
|
|||||||
Return
|
Return
|
||||||
; -------------------------------/SubScribeStar-------------------------------
|
; -------------------------------/SubScribeStar-------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
|
; -------------------------------LinkedIn-------------------------------
|
||||||
|
PostToLinkedIN:
|
||||||
|
CurrentSite := "LinkedIn"
|
||||||
|
|
||||||
; -------------------------------LinkedIn-------------------------------
|
if(StrLen(PostTitleAndBody) > 1300){
|
||||||
PostToLinkedIN:
|
Message = Post longer than LinkedIn's 1300 character limit. Posting Skipped.
|
||||||
CurrentSite := "LinkedIn"
|
|
||||||
|
|
||||||
if(StrLen(PostTitleAndBody) > 1300){
|
|
||||||
Message = Post longer than LinkedIn's 1300 character limit. Posting Skipped.
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
IniWrite, Skipped - Too Long, %StatusFileFilePath%, Status, LinkedIn
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
URLAttempt := NavigateFromBaseURLTo("https://www.linkedin.com/login")
|
|
||||||
if(URLAttempt = "Failed")
|
|
||||||
Return
|
|
||||||
|
|
||||||
Status := CheckCurrentTabForCurrentSite()
|
|
||||||
if(Status){
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
Message = Checking Login Status
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
sleep, 1000
|
IniWrite, Skipped - Too Long, %StatusFileFilePath%, Status, LinkedIn
|
||||||
try CurrentTabURL := driver.Url
|
Return
|
||||||
if(InStr(CurrentTabURL, "login")){
|
}
|
||||||
Message = Login Expired. Please log back in
|
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
URLAttempt := NavigateFromBaseURLTo("https://www.linkedin.com/login")
|
||||||
|
if(URLAttempt = "Failed")
|
||||||
|
Return
|
||||||
|
|
||||||
|
Status := CheckCurrentTabForCurrentSite()
|
||||||
|
if(Status){
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
Message = Checking Login Status
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
sleep, 1000
|
||||||
|
try CurrentTabURL := driver.Url
|
||||||
|
if(InStr(CurrentTabURL, "login")){
|
||||||
|
Message = Login Expired. Please log back in
|
||||||
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Message = Clicking "Start a Post" button
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
|
loop, 3 {
|
||||||
|
Xpath = (//span[normalize-space()='Start a post'])[1] ; start a post button
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
if(!Status)
|
||||||
|
Break
|
||||||
|
; Msgbox % "Status: " Status
|
||||||
|
if(Status AND A_index = 1){
|
||||||
|
try CurrentURL := driver.url
|
||||||
|
Message = Failed to click on "Start a post" button`nChecking Login Status`nCurrent URL: %CurrentURL%
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
try html := driver.pagesource ; save page's entire HTML to a variable
|
||||||
|
if(InStr(HTML, "Sign In") AND InStr(HTML, "Forgot password")){
|
||||||
|
Xpath = //button[normalize-space()='Sign in']
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
|
sleep, 2000
|
||||||
|
driver.Get("https://www.linkedin.com/feed/") ;Open selected URL
|
||||||
|
; driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
else, ; otherwise check and toggle the chat popup on the side
|
||||||
|
{
|
||||||
|
Message = Checking if Chat Sidebar is in the way
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
||||||
|
try html := driver.pagesource ; save page's entire HTML to a variable
|
||||||
|
if(InStr(HTML,"You are on the messaging overlay. Press enter to minimize it.")){ ; if sidebar is open
|
||||||
|
Xpath = //body//div//aside//button[2] ; click to minimize it
|
||||||
|
try driver.FindElementByXPath(Xpath).click()
|
||||||
|
Message = Chat sidebar was minimized
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
Continue ; continue to next loop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
; DevModeMsgBox("test")
|
||||||
|
; Check if linked in post popup appeared
|
||||||
|
Xpath = //div[@aria-label='Text editor for creating content']
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to click into Create Post popup to input post
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Status){
|
||||||
|
Message = Login Expired. Please log back in
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ImageAttachmentFilepath != ""){
|
||||||
|
; Click the upload image button
|
||||||
|
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
; click attach image button
|
||||||
|
Xpath = //li-icon[@type='image']//*[name()='svg']
|
||||||
|
Status := Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to click "Attach Image" button with Selenium
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
Xpath = //input[@id='image-sharing-detour-container__file-input']
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to Attach photo with both attempts.
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(WinExist("Open")) ; if open image popup still exists, close it
|
||||||
|
WinClose, Open
|
||||||
|
; Return
|
||||||
|
}
|
||||||
|
else, {
|
||||||
|
Status := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
|
||||||
|
if(Status)
|
||||||
|
{
|
||||||
|
Message = Failed to input filepath into "Open File" window.
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
; sleep, 10000
|
||||||
|
|
||||||
|
Xpath = //span[normalize-space()='Done'] ; click done button
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to click "Done" button on image upload
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
SaveDriverURLOFErrorPage()
|
SaveDriverURLOFErrorPage()
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
sleep, 5000
|
||||||
|
|
||||||
Message = Clicking "Start a Post" button
|
}
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
|
Message = Inputting Post
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
loop, 3 {
|
; Input Post text contents
|
||||||
Xpath = (//span[normalize-space()='Start a post'])[1] ; start a post button
|
loop, 3 {
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
Xpath = //div[@aria-label='Text editor for creating content'] ; Input text of post
|
||||||
if(!Status)
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||||
Break
|
if(Status){
|
||||||
; Msgbox % "Status: " Status
|
Message = Failed to input post content
|
||||||
if(Status AND A_index = 1){
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
try CurrentURL := driver.url
|
|
||||||
Message = Failed to click on "Start a post" button`nChecking Login Status`nCurrent URL: %CurrentURL%
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
try html := driver.pagesource ; save page's entire HTML to a variable
|
|
||||||
if(InStr(HTML, "Sign In") AND InStr(HTML, "Forgot password")){
|
|
||||||
Xpath = //button[normalize-space()='Sign in']
|
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
|
||||||
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
||||||
sleep, 2000
|
|
||||||
driver.Get("https://www.linkedin.com/feed/") ;Open selected URL
|
|
||||||
; driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
else, ; otherwise check and toggle the chat popup on the side
|
|
||||||
{
|
|
||||||
Message = Checking if Chat Sidebar is in the way
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip")
|
|
||||||
try html := driver.pagesource ; save page's entire HTML to a variable
|
|
||||||
if(InStr(HTML,"You are on the messaging overlay. Press enter to minimize it.")){ ; if sidebar is open
|
|
||||||
Xpath = //body//div//aside//button[2] ; click to minimize it
|
|
||||||
try driver.FindElementByXPath(Xpath).click()
|
|
||||||
Message = Chat sidebar was minimized
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
Continue ; continue to next loop
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
; DevModeMsgBox("test")
|
|
||||||
; Check if linked in post popup appeared
|
|
||||||
Xpath = //div[@aria-label='Text editor for creating content']
|
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to click into Create Post popup to input post
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Status){
|
; Double check that post got input
|
||||||
Message = Login Expired. Please log back in
|
Jscheck = return document.querySelector("div[aria-label='Text editor for creating content']").innerText
|
||||||
|
try Status := driver.executeScript(Jscheck)
|
||||||
|
; DevModeMsgBox(Status)
|
||||||
|
if(StrLen(Status) > 5)
|
||||||
|
Break
|
||||||
|
|
||||||
|
if(A_index = 3){
|
||||||
|
Message = Post Failed: Failed to input Post for some reason
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
; Continue
|
||||||
if(ImageAttachmentFilepath != ""){
|
}
|
||||||
; Click the upload image button
|
|
||||||
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
; click attach image button
|
|
||||||
Xpath = //li-icon[@type='image']//*[name()='svg']
|
|
||||||
Status := Selenium_LoopToClickXpathAndWaitForOpenWindow(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to click "Attach Image" button with Selenium
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
|
|
||||||
Xpath = //input[@id='image-sharing-detour-container__file-input']
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to Attach photo with both attempts.
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
if(WinExist("Open")) ; if open image popup still exists, close it
|
|
||||||
WinClose, Open
|
|
||||||
; Return
|
|
||||||
}
|
|
||||||
else, {
|
|
||||||
Status := InputFilePathIntoOpenWindow(ImageAttachmentFilepath)
|
|
||||||
if(Status)
|
|
||||||
{
|
|
||||||
Message = Failed to input filepath into "Open File" window.
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
; sleep, 10000
|
|
||||||
|
|
||||||
Xpath = //span[normalize-space()='Done'] ; click done button
|
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to click "Done" button on image upload
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveOrPostProgress(Message:="Waiting 5 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
sleep, 5000
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Message = Inputting Post
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
; Input Post text contents
|
|
||||||
loop, 3 {
|
|
||||||
Xpath = //div[@aria-label='Text editor for creating content'] ; Input text of post
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to input post content
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
}
|
|
||||||
|
|
||||||
; Double check that post got input
|
|
||||||
Jscheck = return document.querySelector("div[aria-label='Text editor for creating content']").innerText
|
|
||||||
try Status := driver.executeScript(Jscheck)
|
|
||||||
; DevModeMsgBox(Status)
|
|
||||||
if(StrLen(Status) > 5)
|
|
||||||
Break
|
|
||||||
|
|
||||||
if(A_index = 3){
|
|
||||||
Message = Post Failed: Failed to input Post for some reason
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
; Continue
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if(!Status){ ; if BLANK
|
/* if(!Status){ ; if BLANK
|
||||||
Message = Post Failed: Failed to input Post for some reason
|
Message = Post Failed: Failed to input Post for some reason
|
||||||
@@ -2118,212 +2121,216 @@ if(ImageAttachmentFilepath != ""){
|
|||||||
Return
|
Return
|
||||||
; -------------------------------/LinkedIn-------------------------------
|
; -------------------------------/LinkedIn-------------------------------
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
; -------------------------------Minds-------------------------------
|
; -------------------------------Minds-------------------------------
|
||||||
PostToMinds:
|
PostToMinds:
|
||||||
CurrentSite := "Minds"
|
CurrentSite := "Minds"
|
||||||
|
|
||||||
|
|
||||||
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
URLAttempt := NavigateFromBaseURLTo("https://www.minds.com/newsfeed/subscriptions")
|
URLAttempt := NavigateFromBaseURLTo("https://www.minds.com/newsfeed/subscriptions")
|
||||||
if(URLAttempt = "Failed")
|
if(URLAttempt = "Failed")
|
||||||
|
Return
|
||||||
|
|
||||||
|
Status := CheckCurrentTabForCurrentSite()
|
||||||
|
if(Status){
|
||||||
Return
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
Status := CheckCurrentTabForCurrentSite()
|
sleep, 1000
|
||||||
if(Status){
|
|
||||||
|
try CurrentTabURL := driver.Url
|
||||||
|
; Msgbox % "CurrentTabURL: " CurrentTabURL
|
||||||
|
if(InStr(CurrentTabURL, "login")){
|
||||||
|
Message = Login Cookies Expired. Trying to Re-Login
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
sleep, 2000
|
||||||
|
Xpath = //div[contains(text(),'Login')]
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
|
}
|
||||||
|
|
||||||
|
Message = Clicking into Speak your mind.. Box
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
|
loop, 3 {
|
||||||
|
if(A_index = 3){
|
||||||
|
SaveOrPostProgress(Message:="Failed to click into -speak your mind..- input box.",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep, 1000
|
|
||||||
|
|
||||||
try CurrentTabURL := driver.Url
|
; Click the Big Compose Box at the top of the page
|
||||||
; Msgbox % "CurrentTabURL: " CurrentTabURL
|
Xpath = //div[@class='m-composer__triggerOverlay']
|
||||||
if(InStr(CurrentTabURL, "login")){
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
||||||
Message = Login Cookies Expired. Trying to Re-Login
|
; Status := Selenium_LoopToClickXpath(Xpath,5,1000)
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
if(Status){
|
||||||
sleep, 2000
|
SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
Xpath = //div[contains(text(),'Login')]
|
SaveDriverURLOFErrorPage()
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
Return
|
||||||
driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Message = Clicking into Speak your mind.. Box
|
; check that popup appears by checking for "Create Blog" button in popup
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
js = return document.querySelector("div[class='m-composer__base'] div[class='m-composerTitleBar__createBlogTrigger ng-star-inserted']").innerText
|
||||||
|
try status := driver.executeScript(js)
|
||||||
|
if(InStr(Status, "Create Blog")){
|
||||||
loop, 3 {
|
break
|
||||||
if(A_index = 3){
|
}
|
||||||
SaveOrPostProgress(Message:="Failed to click into -speak your mind..- input box.",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
else, {
|
||||||
SaveDriverURLOFErrorPage()
|
continue
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
; Click the Big Compose Box at the top of the page
|
|
||||||
Xpath = //div[@class='m-composer__triggerOverlay']
|
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=10,SleepLength:=1000)
|
|
||||||
; Status := Selenium_LoopToClickXpath(Xpath,5,1000)
|
|
||||||
if(Status){
|
|
||||||
SaveOrPostProgress(Message:="Login Expired. Please log back in",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
; check that popup appears by checking for "Create Blog" button in popup
|
|
||||||
js = return document.querySelector("div[class='m-composer__base'] div[class='m-composerTitleBar__createBlogTrigger ng-star-inserted']").innerText
|
|
||||||
try status := driver.executeScript(js)
|
|
||||||
if(InStr(Status, "Create Blog")){
|
|
||||||
break
|
|
||||||
}
|
|
||||||
else, {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
; Msgbox % "status: " status
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; Attach Image
|
; Msgbox % "status: " status
|
||||||
if(ImageAttachmentFilepath != ""){
|
|
||||||
; Click the upload image button
|
|
||||||
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
|
|
||||||
|
|
||||||
Xpath = //input[@type='file']
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
}
|
||||||
|
|
||||||
|
; Attach Image
|
||||||
|
if(ImageAttachmentFilepath != ""){
|
||||||
|
; Click the upload image button
|
||||||
|
SaveOrPostProgress(Message:="Attaching Image",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
|
Xpath = //input[@type='file']
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=ImageAttachmentFilepath)
|
||||||
|
if(Status){
|
||||||
|
Message = Failed to attach image (E#1203)
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveOrPostProgress(Message:="Waiting 2 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
sleep, 2000
|
||||||
|
|
||||||
|
|
||||||
|
SaveOrPostProgress(Message:="Inputting Post Content`nMight take 5-15 seconds to get input",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
; Click the plus button to make the title box show up
|
||||||
|
Xpath = //div[@class='m-composer__base m-composer__base--withPreview']//i[@class='material-icons ng-star-inserted'][normalize-space()='add_circle_outline']
|
||||||
|
try driver.FindElementByXPath(Xpath).click()
|
||||||
|
catch e { ; if failed to plus button, then input the post body and text into the same box
|
||||||
|
; msgbox, failed to click Plus
|
||||||
|
; goto, InputMindsPostCombined
|
||||||
|
}
|
||||||
|
|
||||||
|
; if plus button was clicked successfully, input title and body individually
|
||||||
|
; Input title
|
||||||
|
; Msgbox % "PostTitle: " PostTitle
|
||||||
|
Xpath = //textarea[@placeholder='Title']
|
||||||
|
; driver.FindElementByXPath(Xpath).SendKeys("heleeoeoe")
|
||||||
|
|
||||||
|
; CLick into title box
|
||||||
|
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
||||||
|
|
||||||
|
; Input text itno title box
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle)
|
||||||
|
if(Status){ ; if failed to input title then skip to inputting both combined
|
||||||
|
; msgbox, failed to input title
|
||||||
|
Message = Failed to input Title
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
|
MindsTitleStatus := "Failed"
|
||||||
|
; Return
|
||||||
|
|
||||||
|
; goto, InputMindsPostCombined
|
||||||
|
}
|
||||||
|
|
||||||
|
; msgbox, title input?
|
||||||
|
; Input body
|
||||||
|
if(MindsTitleStatus)
|
||||||
|
MindsPost := PostTitleAndBody
|
||||||
|
else, MindsPost := PostBody
|
||||||
|
|
||||||
|
; Msgbox % "PostBody: " PostBody
|
||||||
|
Xpath = //textarea[@id='minds-m-composer__textarea--1003']
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=MindsPost)
|
||||||
|
if(Status){
|
||||||
|
; msgbox, failed to input body
|
||||||
|
Message = Failed to post with Xpath, trying with ID
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
Status := Selenium_LoopToSendValueToID("minds-m-composer__textarea--1003",5,1000,MindsPost)
|
||||||
if(Status){
|
if(Status){
|
||||||
Message = Failed to attach image (E#1203)
|
Message = Failed to input Post Content into Page
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
SaveDriverURLOFErrorPage()
|
SaveDriverURLOFErrorPage()
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SaveOrPostProgress(Message:="Waiting 2 seconds for Image to finish uploading",PostType:="Tooltip,ErrorLoggingTextFile")
|
}
|
||||||
|
else, { ; otherwise, input just text
|
||||||
sleep, 2000
|
SaveOrPostProgress(Message:="Inputting Text Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
; DevModeMsgBox("Inputting Text Post")
|
||||||
|
Xpath = //textarea[@id='minds-m-composer__textarea--1003']
|
||||||
|
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
||||||
|
|
||||||
|
|
||||||
SaveOrPostProgress(Message:="Inputting Post Content`nMight take 5-15 seconds to get input",PostType:="Tooltip,ErrorLoggingTextFile")
|
if(Status){
|
||||||
|
Message = Failed to post with Xpath, trying with ID
|
||||||
; Click the plus button to make the title box show up
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
Xpath = //div[@class='m-composer__base m-composer__base--withPreview']//i[@class='material-icons ng-star-inserted'][normalize-space()='add_circle_outline']
|
Status := Selenium_LoopToSendValueToID("minds-m-composer__textarea--1003",5,1000,PostTitleAndBody)
|
||||||
try driver.FindElementByXPath(Xpath).click()
|
|
||||||
catch e { ; if failed to plus button, then input the post body and text into the same box
|
|
||||||
; msgbox, failed to click Plus
|
|
||||||
; goto, InputMindsPostCombined
|
|
||||||
}
|
|
||||||
|
|
||||||
; if plus button was clicked successfully, input title and body individually
|
|
||||||
; Input title
|
|
||||||
; Msgbox % "PostTitle: " PostTitle
|
|
||||||
Xpath = //textarea[@placeholder='Title']
|
|
||||||
; driver.FindElementByXPath(Xpath).SendKeys("heleeoeoe")
|
|
||||||
|
|
||||||
; CLick into title box
|
|
||||||
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
|
|
||||||
|
|
||||||
; Input text itno title box
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitle)
|
|
||||||
if(Status){ ; if failed to input title then skip to inputting both combined
|
|
||||||
; msgbox, failed to input title
|
|
||||||
Message = Failed to input Title
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
|
|
||||||
MindsTitleStatus := "Failed"
|
|
||||||
; Return
|
|
||||||
|
|
||||||
; goto, InputMindsPostCombined
|
|
||||||
}
|
|
||||||
|
|
||||||
; msgbox, title input?
|
|
||||||
; Input body
|
|
||||||
if(MindsTitleStatus)
|
|
||||||
MindsPost := PostTitleAndBody
|
|
||||||
else, MindsPost := PostBody
|
|
||||||
|
|
||||||
; Msgbox % "PostBody: " PostBody
|
|
||||||
Xpath = //textarea[@id='minds-m-composer__textarea--1003']
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=MindsPost)
|
|
||||||
if(Status){
|
if(Status){
|
||||||
; msgbox, failed to input body
|
Message = Failed to input Post Content into Page
|
||||||
Message = Failed to post with Xpath, trying with ID
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
SaveDriverURLOFErrorPage()
|
||||||
Status := Selenium_LoopToSendValueToID("minds-m-composer__textarea--1003",5,1000,MindsPost)
|
Return
|
||||||
if(Status){
|
|
||||||
Message = Failed to input Post Content into Page
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else, { ; otherwise, input just text
|
}
|
||||||
SaveOrPostProgress(Message:="Inputting Text Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
||||||
; DevModeMsgBox("Inputting Text Post")
|
|
||||||
Xpath = //textarea[@id='minds-m-composer__textarea--1003']
|
|
||||||
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=PostTitleAndBody)
|
|
||||||
|
|
||||||
DevModeMsgBox("done")
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to post with Xpath, trying with ID
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
Status := Selenium_LoopToSendValueToID("minds-m-composer__textarea--1003",5,1000,PostTitleAndBody)
|
|
||||||
if(Status){
|
|
||||||
Message = Failed to input Post Content into Page
|
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
||||||
SaveDriverURLOFErrorPage()
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(InStr(PostBody,"http"))
|
if(InStr(PostBody,"http"))
|
||||||
{
|
{
|
||||||
Message = Sleeping 5 seconds for preview to load
|
Message = Sleeping 5 seconds for preview to load
|
||||||
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
sleep, 5000
|
sleep, 5000
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
; sleep, 2000
|
; sleep, 2000
|
||||||
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:="Submitting Post",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
|
|
||||||
|
|
||||||
loop, 3 {
|
loop, 3 {
|
||||||
if(A_index = 3){
|
if(A_index = 3){
|
||||||
SaveOrPostProgress(Message:="Failed to submit post",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:="Failed to submit post",PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
SaveDriverURLOFErrorPage()
|
SaveDriverURLOFErrorPage()
|
||||||
Return
|
Return
|
||||||
}
|
}
|
||||||
|
|
||||||
; click submit button
|
; click submit button
|
||||||
js = document.querySelector("button[class='m-button m-button--blue m-button--small m-button--dropdown'] span[class='ng-star-inserted']").click();
|
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)
|
try status := driver.executeScript(js)
|
||||||
catch e {
|
catch e {
|
||||||
Msgbox % "status: " status
|
Message = Clicking submit button with JS resulted in status: %status%
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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")
|
||||||
sleep, 5000
|
sleep, 5000
|
||||||
|
|
||||||
; check that popup appears by checking for "Create Blog" button in popup
|
; check that popup appears by checking for "Create Blog" button in popup
|
||||||
js = return document.querySelector("div[class='m-composer__base'] div[class='m-composerTitleBar__createBlogTrigger ng-star-inserted']").innerText
|
js = return document.querySelector("div[class='m-composer__base'] div[class='m-composerTitleBar__createBlogTrigger ng-star-inserted']").innerText
|
||||||
try status := driver.executeScript(js)
|
try status := driver.executeScript(js)
|
||||||
if(InStr(Status, "Create Blog")){
|
if(InStr(Status, "Create Blog")){
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
else, {
|
else, {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* if(!TestingMode){
|
/* if(!TestingMode){
|
||||||
@@ -2361,71 +2368,80 @@ if(ImageAttachmentFilepath != ""){
|
|||||||
Return
|
Return
|
||||||
; -------------------------------/Minds-------------------------------
|
; -------------------------------/Minds-------------------------------
|
||||||
|
|
||||||
; -------------------------------Locals-------------------------------
|
/*
|
||||||
PostToLocals:
|
*/
|
||||||
CurrentSite := "Locals"
|
|
||||||
; DevModeMsgBox("clik ok to continue")
|
|
||||||
; @todo: Add auto-login to locals
|
|
||||||
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
|
|
||||||
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL
|
; -------------------------------Locals-------------------------------
|
||||||
Message = LocalsURL from Ini File: %LocalsURL%
|
PostToLocals:
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
CurrentSite := "Locals"
|
||||||
|
; DevModeMsgBox("clik ok to continue")
|
||||||
|
; @todo: Add auto-login to locals
|
||||||
|
SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
; LocalsURL := StrReplace(Localsurl, "/share/post", "")
|
IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space%
|
||||||
; LocalsURL := Localsurl . "/login"
|
if(LocalsURL = ""){
|
||||||
; Message = Localsurl: %LocalsURL%
|
Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
Status := NavigateFromBaseURLTo(LocalsURL)
|
; Message = LocalsURL from Ini File: %LocalsURL%
|
||||||
if(Status = "Failed")
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
Return
|
|
||||||
|
|
||||||
Status := CheckCurrentTabForCurrentSite()
|
; LocalsURL := StrReplace(Localsurl, "/share/post", "")
|
||||||
if(Status){
|
; LocalsURL := Localsurl . "/login"
|
||||||
Return
|
; Message = Localsurl: %LocalsURL%
|
||||||
}
|
; SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging")
|
||||||
sleep, 1000
|
|
||||||
|
|
||||||
Message = Checking Login Status
|
Status := NavigateFromBaseURLTo(LocalsURL)
|
||||||
|
if(Status = "Failed")
|
||||||
|
Return
|
||||||
|
|
||||||
try CurrentTabURL := driver.Url
|
Status := CheckCurrentTabForCurrentSite()
|
||||||
if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
if(Status){
|
||||||
Message = Login Expired. Please log back in
|
Return
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
}
|
||||||
SaveDriverURLOFErrorPage()
|
sleep, 1000
|
||||||
Return
|
|
||||||
}
|
|
||||||
|
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
Message = Checking Login Status
|
||||||
; Xpath = //textarea[@id='body']
|
|
||||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=2000)
|
|
||||||
; if(Status){
|
|
||||||
; Message = Trying to Log Back In
|
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
|
||||||
|
|
||||||
; LocalsLoginURL := LocalsURL . "/login"
|
try CurrentTabURL := driver.Url
|
||||||
; try driver.Get(LocalsLoginURL) ;Open selected URL
|
if(InStr(CurrentTabURL, "/login") OR InStr(CurrentTabURL, "/register")){
|
||||||
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
Message = Login Expired. Please log back in
|
||||||
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
SaveDriverURLOFErrorPage()
|
||||||
|
Return
|
||||||
|
}
|
||||||
|
|
||||||
; sleep, 3000
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
||||||
; js = document.getElementsByName('submit')[0].click();
|
; Xpath = //textarea[@id='body']
|
||||||
; try driver.executeScript(js)
|
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=2000)
|
||||||
; ; DevModeMsgBox(js)
|
; if(Status){
|
||||||
; ; clipboard := js
|
; Message = Trying to Log Back In
|
||||||
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
|
||||||
|
|
||||||
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
; LocalsLoginURL := LocalsURL . "/login"
|
||||||
; sleep, 5000
|
; try driver.Get(LocalsLoginURL) ;Open selected URL
|
||||||
; ; try driver.Get(LocalsURL) ;Open selected URL
|
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
; ; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
|
||||||
|
|
||||||
; Xpath = //textarea[@id='body']
|
; sleep, 3000
|
||||||
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
; js = document.getElementsByName('submit')[0].click();
|
||||||
; {
|
; try driver.executeScript(js)
|
||||||
; Message = Post Failed: Check Login Status
|
; ; DevModeMsgBox(js)
|
||||||
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
; ; clipboard := js
|
||||||
; Return
|
|
||||||
; }
|
; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
|
; sleep, 5000
|
||||||
|
; ; try driver.Get(LocalsURL) ;Open selected URL
|
||||||
|
; ; try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
|
||||||
|
|
||||||
|
; Xpath = //textarea[@id='body']
|
||||||
|
; Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=5,SleepLength:=2000)
|
||||||
|
; {
|
||||||
|
; Message = Post Failed: Check Login Status
|
||||||
|
; SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
; Return
|
||||||
|
; }
|
||||||
|
|
||||||
/* Message = Post Failed: Check Login Status
|
/* Message = Post Failed: Check Login Status
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
||||||
|
|||||||
Reference in New Issue
Block a user