Selenium Ide - drop down

115 views
Skip to first unread message

Mohit Goel

unread,
Dec 8, 2015, 12:27:23 PM12/8/15
to Selenium Users

hi,

I have searched a lot for drop down selection manually , but cant get good feedback.

Please help. Let it be simple for gmail new account creation and selecting date of month.

I am selecting id ":0" and what will i use in command to select may month.

Xpath also not working.


Thanks
Mohit goel

mohit...@gmail.com

Zahi Zilberman

unread,
Dec 9, 2015, 2:57:31 AM12/9/15
to Selenium Users
Try clicking and then send keys with the correct month, than send key Enter.
I believe your real trouble will be the captcha if you're really after automating the new account.

Siva Kumar

unread,
Dec 10, 2015, 4:14:50 AM12/10/15
to Selenium Users

Gmail Account Creation
On Tuesday, December 8, 2015 at 10:57:23 PM UTC+5:30, Mohit Goel wrote:

package TestNG;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;

public class GmailAccountCreation {
public WebDriver driver;
String str="//div[@class='goog-inline-block goog-flat-menu-button jfk-select']";
  @Test
  public void gmail() throws Exception {
//  driver.findElement(By.linkText("Add account")).click();
 driver.findElement(By.linkText("Create account")).click();
 Thread.sleep(2000);
 driver.findElement(By.id("FirstName")).sendKeys("siva");
 driver.findElement(By.id("LastName")).sendKeys("kumar");
 driver.findElement(By.id("GmailAddress")).sendKeys("a9108650323");
 driver.findElement(By.id("Passwd")).sendKeys("9108650323");
 driver.findElement(By.id("PasswdAgain")).sendKeys("9108650323");
 driver.findElement(By.xpath(str)).click();
 driver.findElement(By.xpath("//div[@class='goog-menuitem-content' and contains (text(),'April')]")).click();
 driver.findElement(By.id("BirthDay")).sendKeys("12");
 driver.findElement(By.id("BirthYear")).sendKeys("1992");
 driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[1]/div/form/div[6]/label/div/div")).click();
 Thread.sleep(7000);
 driver.findElement(By.xpath("//div[@class='goog-menuitem-content' and contains (text(),'Male')]")).click();
 driver.findElement(By.xpath("//div[@class='goog-inline-block i18n-phone-select-country-dropdown']")).click();
 driver.findElement(By.xpath("//div[@class='i18n-phone-flag']")).click();
 driver.findElement(By.id("RecoveryPhoneNumber")).sendKeys("9108650323");
 driver.findElement(By.id("RecoveryEmailAddress")).sendKeys("dsivakum...@gmail.com");
 driver.findElement(By.id("SkipCaptcha")).click();
 driver.findElement(By.id(":h")).click();
 driver.findElement(By.xpath("//div[@class='goog-menuitem-content' and contains (text(),'India (भारत)')]")).click();
 driver.findElement(By.id("TermsOfService")).click();
 
  }
  @BeforeTest
  public void beforeTest() {
 driver=new FirefoxDriver();
 driver.manage().window().maximize();
  }

}

Reply all
Reply to author
Forward
0 new messages