在webDriver中处理JavaScript所生成的alert、confirm、以及prompt十分简单,可以使用switch_to_alert()方法定位到alert、confirm、prompt,然后使用text、accept、dismiss、send_keys等方法进行操作
text:返回alert、confirm、prompt中的文字信息
accept():接受现有警告框
dismiss():解散现有警告框
send_keys(keysToSend):发送文本至警告框