Warning: Undefined array key "path" in /www/wwwroot/binbinbijissss/wp-content/plugins/wp-chinese-conversion/wp-chinese-conversion.php on line 633
php-webdriver怎麼定位到iframe,php-webdriver怎麼在iframe輸入參數_彬彬筆記

php-webdriver怎麼定位到iframe,php-webdriver怎麼在iframe輸入參數

使用php-webdriver登錄的時候,可能會遇到的問題,登錄框是iframe彈出來的,這個時候就不能正常輸入了

需要先定位到iframe裡面去,然後再按照正常的方法獲取css那些

話不多說,直接上代碼

$driver->switchTo()->frame(0); //用frame的index來定位,第一個是0,親測有效

還有其他的方法,但是我使用這個方法成功了,如果後續測試其他方法成功了,再添加上去

參考網址:https://github.com/php-webdriver/php-webdriver/wiki/Alert,-tabs,-frames,-iframes

到此為止。

發布者:彬彬筆記,轉載請註明出處:https://www.binbinbiji.com/zh-hant/php/2844.html

贊 (0)
彬彬筆記彬彬筆記
windows server 2022 取消開機彈出服務器管理器
上一篇 2022年8月8日 19:22
運行php程序出現Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in xxxxxxxx on line 6的解決辦法
下一篇 2022年9月26日 11:57

相關推薦

發表回復

登錄後才能評論
蜀ICP備14017386號-13