Issue
WebDriverWait(self.driver,10).until(expected_conditions.url_changes("https://someurl.com))
self.driver.find_element(By.LINK_TEXT, "Sparkles").click()
So, my driver doesn't wait for url to change, it's like it passes that line and goes straight to click, so click happens before page loads and everything brakes there ofcourse.
WebDriverWait(self.driver,10).until(expected_conditions.element_to_be_clickable(self.driver.find_element(By.CSS_SELECTOR, "div:nth-child(2) > .ant-card > .ant-card-body > .ant-checkbox-wrapper .ant-checkbox-input")))
self.driver.find_element(By.CSS_SELECTOR, "div:nth-child(2) > .ant-card > .ant-card-body > .ant-checkbox-wrapper .ant-checkbox-input").click()
This one also doesn't work, it just clicks (and the 1st block of code is before this one).I also want to add that even "time.sleep(10)" doesn't work, and I'm using it with Azure functions core tools (if it makes any difference).Thanks
Solution
I don't know if I can accept this as an answer to this question, but this is what I found. So, I was asked in comments to provide link to the website I'm using this on (which I couldn't do). After that, it occurred to me that it might be the website that is the problem, so I tested it on another website, and it works. Unfortunately, I don't know what is the issue with the website, but I'll leave this so someone who has the same problem sees that this can happen also (feel free to remove this if it shouldn't be labeled as an answer).
Answered By - LosProgramer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.