1

Currently i wish to run selenium for test excel upload. And my coding didn't working as expected. Just wondering how to resolve it. Every time i run the automated testing my code will be stop at this step:sendKeys("C:\Users\user\Desktop\JSPL Style Excel Upload.csv") without any error message show. Any suggestion?

  @Before
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://localhost:7101/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

public void testJava() throws Exception {
    driver.get(baseUrl + "SCM_Telephone_Accounting_2-ViewController-context-root/faces/Main_Menu");
    driver.findElement(By.id("np2:cni10")).click();
    driver.findElement(By.id("r1:1:if1::content")).click();
    driver.findElement(By.id("r1:1:if1::content")).clear();
    driver.findElement(By.id("r1:1:if1::content")).sendKeys("C:\\Users\\user\\Desktop\\JSPL Style Excel Upload.csv");
    driver.findElement(By.id("r1:1:cb1")).click();
  }
7
  • 3
    What exactly do you mean by "And my coding didn't working as expected." What are you expecting, and how does the outcome of this code differ? Commented Jan 13, 2015 at 8:40
  • Have you looked at similar questions such as stackoverflow.com/questions/6128208/… ? Commented Jan 13, 2015 at 8:42
  • @JonnyHenly: my auto run test case will be stop at this step: driver.findElement(By.id("r1:1:if1::content")).sendKeys("C:\\Users\\user\\Desktop\\JSPL Style Excel Upload.csv"); Commented Jan 13, 2015 at 8:48
  • @reto: i testing the method now. Commented Jan 13, 2015 at 8:52
  • 1
    I resolve it already~ The link provided by @reto really work. Thank you very much. (^^) Commented Jan 14, 2015 at 2:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.