added fix for login sometimes failing for Media Manager

main
Yuriy 4 days ago
parent 2ed71756d0
commit 5cae8f6fa3

@ -122,9 +122,17 @@ SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
Xpath = //input[@id='email']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
; Selenium can't clear out text that's prepopulated by chrome or a password manager until we send some input to the element
; So we input text, then clear it and then input the string we want to work around this.
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Username)
if(!Status){ ; if inputting email did NOT fail, then we are on the login page, input the password and then click login.
Xpath = //input[@id='password']
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
try, driver.findelementbyxpath(Xpath).clear() ; clear input field in case it's autofilled by chrome or password manager
Status := Selenium_LoopToSendValueToXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000,StringTextContent:=Password)
Xpath = //a[@id='loginButton']
Status := Selenium_LoopToClickXpath(Xpath:=Xpath,NumOfLoops:=2,SleepLength:=1000)
@ -271,13 +279,15 @@ ArrayOfPodcastTags := StrSplit(Podcasttags,",")
LengthOfArrayOfPodcastTags := ArrayOfPodcastTags.Length() ; Save total number of items in the array
try pagehtml := driver.pagesource
; Msgbox % "pagehtml: " pagehtml
Loop, %LengthOfArrayOfPodcastTags% {
Tag := ArrayOfPodcastTags[A_Index] ; find value from position in array
SpanID = title">%Tag%</span></div></li><li><div id="tagIDs_easyui_tree_
if(InStr(pagehtml, SpanID)){ ; if tag found in page, do this
; if tag found in the raw HTML source, get the tag # from the source code and use it to click on the appropriate checkbox
if(InStr(pagehtml, SpanID)){
number := StrSplit(pagehtml, SpanID)
Number := Number[2]
; Msgbox % "number: " number

Loading…
Cancel
Save