0
Facebookのログインページで[アカウントを作成]ボタンをクリックできません。 Genderとは別のWeb要素がないので、Listにラジオボタンを格納することはできません。Javaを使用してセレンを使用してFacebookのサインアッププロセスを自動化しますが、ラジオボタンを選択できません
public static void main(String[] args) {
WebDriver fb = new FirefoxDriver();
fb.get("https://www.facebook.com/");
fb.findElement(By.xpath("id('u_0_1')")).sendKeys("Tomprakash");
fb.findElement(By.xpath("id('u_0_3')")).sendKeys("Sahu");
fb.findElement(By.xpath("id('u_0_6')")).sendKeys("7869084527");
fb.findElement(By.xpath("id('u_0_9')")).sendKeys("7869084527");
fb.findElement(By.xpath("id('u_0_b')")).sendKeys("cs083595");
Select date = new Select(fb.findElement(By.xpath("id('day')")));
date.selectByVisibleText("24");
Select month = new Select(fb.findElement(By.xpath("id('month')")));
month.selectByVisibleText("Dec");
Select year = new Select(fb.findElement(By.xpath("id('year')")));
year.selectByVisibleText("1989");
fb.findElement(By.className("_58mt")).click(); //this code is working for female
//fb.findElement(By.className("_5k")).click(); //this code is not working for male
fb.findElement(By.name("Create an account")).submit();
}
}
あなたが男性のラジオボタンを選択することができないことを言っていますか? – ChanChow
「アカウントを作成」という名前のweb要素は表示されません。 By.id( "u_0_j")をサインアップに使用することができます。そのことが分かれば教えてください。 – ChanChow