如何自动化新的Facebook注册弹出窗口?

huangapple go评论60阅读模式
英文:

How to Automate new Facebook Sign up popup?

问题

我已经尝试自动化Facebook注册页面(新版本包含弹出窗口)。我尝试切换到iframe,但是未能找到它。

请帮助我。请分享代码。

英文:

I've tried to Automate Facebook Signup page (new version consists of a popup). I've tried to switch to iframe but I've failed to find it.

Please help me. Please share the code.

答案1

得分: 0

我认为“Sign-up” 输入字段不在“iframe”中,所以您不需要切换。

英文:

I think Sign-up input fields are NOT in the iframe, so you don't need to switch.

答案2

得分: 0

下面的代码对我起作用。注册部分不是任何新的弹出窗口或框架。所以不需要切换到任何框架或窗口。只需定位字段,并使用sendKeys、click等方法输入所需数据。

    WebDriver Driver = new ChromeDriver();
	Driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	//Driver.manage().window().maximize();
	String url = "https://www.facebook.com/";
	Driver.get(url);
	WebElement createAcount=Driver.findElement(By.id("u_0_2"));
	createAcount.click();
	WebElement firstname=Driver.findElement(By.id("u_1_b"));
	firstname.sendKeys("Tina");
	WebElement surname=Driver.findElement(By.id("u_1_d"));
	surname.sendKeys("Roy");
英文:

The code below worked for me. Signup section is not any new pop-up window or frame. So don't need to switch to any frame or window. Just locate the fields and enter the required data using methods like sendKeys, clicks etc.

    WebDriver Driver = new ChromeDriver();
	Driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	//Driver.manage().window().maximize();
	String url = "https://www.facebook.com/";
	Driver.get(url);
	WebElement createAcount=Driver.findElement(By.id("u_0_2"));
	createAcount.click();
	WebElement firstname=Driver.findElement(By.id("u_1_b"));
	firstname.sendKeys("Tina");
	WebElement surname=Driver.findElement(By.id("u_1_d"));
	surname.sendKeys("Roy");

答案3

得分: 0

只是进行这个测试。这些元素是动态生成的,因此它们每次都有不同的值。通过更多属性对元素进行分组选择。

英文:

Just doing this test. The elements are dynamically generated so they have different values everytime. Group the element selection by more attributes

huangapple
  • 本文由 发表于 2020年8月19日 19:59:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/63486499.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定