Not able to enter using the send key-please help & suggest | Selenium Forum
M
Posted on 29/05/2016
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import com.google.common.base.Predicate;

public class Bing_Search {

@Test

Not able to enter using the send key-please help & suggest

public void bing_serch(){
FirefoxDriver d1= new FirefoxDriver();
d1.get("http://www.bing.com/");
System.out.println(d1.getTitle());
d1.findElement(By.xpath("//*[@id='id_s']")).click();

WebDriverWait wait=new WebDriverWait(d1,10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='b_idProviders']/li/a/span[2]"))).click();
System.out.println(d1.getTitle());

//d1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

d1.findElementByXPath("./

M
Replied on 30/05/2016

what is the problem?


M
Replied on 30/05/2016

Unable to enter or send the username using sendkey


M
Replied on 31/05/2016

send the code.


M
Replied on 31/05/2016

Please check the post , it's already there


M
Replied on 31/05/2016

where is the send keys?

[quote:1lbtd3mv]
public void bing_serch(){
FirefoxDriver d1= new FirefoxDriver();
d1.get("http://www.bing.com/");
System.out.println(d1.getTitle());
d1.findElement(By.xpath("//*[@id='id_s']")).click();

WebDriverWait wait=new WebDriverWait(d1,10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='b_idProviders']/li/a/span[2]"))).click();
System.out.println(d1.getTitle());

//d1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

d1.findElementByXPath("./
[/quote:1lbtd3mv]


M
Replied on 04/06/2016

//import org.openqa.selenium.Alert;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;

import com.google.common.base.Predicate;

public class Bing_Search {

@Test

public void bing_serch(){
FirefoxDriver d1= new FirefoxDriver();
d1.get("http://www.bing.com/");
System.out.println(d1.getTitle());
d1.findElement(By.xpath("//*[@id='id_s']")).click();

WebDriverWait wait=new WebDriverWait(d1,10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='b_idProviders']/li/a/span[2]"))).click();
System.out.println(d1.getTitle());

//d1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

d1.findElementByXPath(".//*[contains(text(),'Email or phone')]").sendKeys("eesandeep@outlook.com");
System.out.println("Enter ");


M
Replied on 05/06/2016

Where is the main method ?


M
Replied on 05/06/2016

Try this ...just updated your code only...

package Rough;

import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class temp_bing {
public static void main(String[] args){
bing_search();
}
public static void bing_search(){
FirefoxDriver d1= new FirefoxDriver();
d1.get("http://bing.com");
System.out.println(d1.getTitle());
d1.findElement(By.xpath(".//*[@id='id_s']")).click();

WebDriverWait wait=new WebDriverWait(d1,10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='b_idProviders']/li/a/span[2]"))).click();
System.out.println(d1.getTitle());
d1.findElementByXPath(".//*[@id='i0116']").sendKeys("eesandeep@outlook.com");
d1.findElementByXPath(".//*[@id='i0118']").sendKeys("Password");
d1.findElementByXPath(".//*[@id='idSIButton9']").click();
System.out.println("Enter ");


}}


M
Replied on 06/06/2016

"[color=#FF0000:ae4ycez5]eesandeep@gmail.com[/color:ae4ycez5]" did you try [color=#FF0000:ae4ycez5]pachu420[/color:ae4ycez5] code?