簡體   English   中英

為什么當瀏覽器是Google Chrome時第二次點擊操作不運行

[英]why 2nd click action is not run when browser is Google Chrome

我不知道為什么當瀏覽器是Google Chrome時不能運行第二次點擊動作。 第一個輸入操作:輸入文本已完成,然后第二個單擊操作無法運行,並且UI上沒有任何反應。 有人可以告訴我原因嗎?

測試鏈接: https : //www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss

從硒導入webdriver driver = webdriver.Chrome()
driver.get(' https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss ')driver.find_element_by_id(“ modelnumber”)。send_keys(“ 7383AC1”)driver.find_element_by_name ( “提交”)。點擊()

該頁面包含3個名稱為“ submit”的元素,因此ChromeDriver可能試圖單擊您不期望的元素。

嘗試通過xpath或CSS查找。 我對XPath更加熟悉:

driver.find_element_by_xpath("//input[@id='modelnumber']/../following-sibling::td/input[@name='submit']").click()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM