在Firefox浏览器中,gmail密码字段的xpath是什么 [英] What is the xpath of gmail password field in firefox browser

查看:88
本文介绍了在Firefox浏览器中,gmail密码字段的xpath是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Selenium Webdriver和Firebug在firefox浏览器中自动运行gmail.

I am trying to automate gmail in firefox browser using selenium webdriver and firebug.

硒不能识别密码fileld的xpath.

Selenium is not identify the xpath of the password fileld.

密码字段的xpath是什么.

what is the xpath of the password field.

推荐答案

在尝试使用 EmailID/Phone 字段填写 Gmail帐户时,您尝试登录文本并同时单击 Next 按钮,密码的文本字段需要花费一定时间才能在 xpath 的问题之外密码字段中,您必须引起一些显式等待,即 WebDriverWait ,如下所示:

While you try to log into your Gmail Account, on filling up the EmailID/Phone field with text and simultaneously click on the Next button, the text field for Password takes a delta amount of time to be clickable/interactable within the Viewport. Hence apart from just locating the xpath for Password field you have to induce some Explicit Wait i.e. WebDriverWait as follows:

WebDriverWait wait = new WebDriverWait(driver, 20);
WebElement password = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@name='password']")));
password.sendKeys("your_password");

这篇关于在Firefox浏览器中,gmail密码字段的xpath是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆