forked from mrlan/EnglishPal
				
			delete
							parent
							
								
									101506a511
								
							
						
					
					
						commit
						630cb6befa
					
				|  | @ -37,11 +37,8 @@ def select(driver): | ||||||
|     actions.move_to_element(text_element) |     actions.move_to_element(text_element) | ||||||
| 
 | 
 | ||||||
|     # 模拟鼠标按下并拖动以选择文本 |     # 模拟鼠标按下并拖动以选择文本 | ||||||
|     # 假设我们想要选择从第10个字符开始的5个字符 |  | ||||||
|     actions.double_click() |     actions.double_click() | ||||||
|     actions.perform() |     actions.perform() | ||||||
|     #actions.move_by_offset(100, 0) |  | ||||||
|     #actions.move_by_offset(10, 0) |  | ||||||
|     actions.release()             # 释放鼠标按钮 |     actions.release()             # 释放鼠标按钮 | ||||||
| 
 | 
 | ||||||
| def test_selected_second_word(driver, URL): | def test_selected_second_word(driver, URL): | ||||||
|  | @ -57,10 +54,8 @@ def test_selected_second_word(driver, URL): | ||||||
|         actions.move_to_element(text_element) |         actions.move_to_element(text_element) | ||||||
| 
 | 
 | ||||||
|         # 模拟鼠标按下并拖动以选择文本 |         # 模拟鼠标按下并拖动以选择文本 | ||||||
|         # 假设我们想要选择从第10个字符开始的5个字符 |  | ||||||
|         actions.double_click() |         actions.double_click() | ||||||
|         actions.perform() |         actions.perform() | ||||||
|         #actions.move_by_offset(10, 0) |  | ||||||
| 
 | 
 | ||||||
|         # 获取选中的文本 |         # 获取选中的文本 | ||||||
|         selected_words = driver.find_element(By.ID, 'selected-words').get_attribute('value') |         selected_words = driver.find_element(By.ID, 'selected-words').get_attribute('value') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue