Created
February 22, 2018 16:49
-
-
Save masbog/8f1729f6a953a1fbb4185eb249859558 to your computer and use it in GitHub Desktop.
SELENIUM WebDriver Python for https://typing-speed-test.aoeu.eu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmpElem_input_words = WebDriverWait(self.driver, 2).until(EC.presence_of_element_located((By.XPATH, '//div[@id="wordsbox"]'))) | |
current_text = WebDriverWait(tmpElem_input_words, 2).until(EC.presence_of_element_located((By.XPATH, '//span[@class="currentword"]'))) | |
inputan = WebDriverWait(self.driver, 5).until(EC.presence_of_element_located((By.XPATH, "//input[@autocomplete='off' and @autocapitalize='none' and @placeholder='type the words here']"))) | |
ActionChains(self.driver).move_to_element(inputan).perform() | |
spans = tmpElem_input_words.find_elements_by_tag_name("span") | |
for span in spans: | |
print(current_text.text) | |
listresp = list(map(list, current_text.text)) | |
listff =[] | |
#print (listresp) | |
for charersp in listresp: | |
for charfinnal in charersp: | |
listff.append(charfinnal) | |
for char in listff: | |
#print(char) | |
inputan.send_keys(char) | |
time.sleep(0.05) | |
inputan.send_keys(' ') | |
time.sleep(0.05) | |
current_text = WebDriverWait(tmpElem_input_words, 2).until(EC.presence_of_element_located((By.XPATH, '//span[@class="currentword"]'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment