Unable to click on the “Browse” button using webdriver | Selenium Forum
M
Posted on 09/10/2016
I need to click on the [b:ohsiit4o]"Browse"[/b:ohsiit4o] button on the below webpage.

[b:ohsiit4o][u:ohsiit4o]http://www.guru99.com/freelancing.html[/u:ohsiit4o][/b:ohsiit4o]

I have written the below code but webdriver fails to find the Browse button element. Please help.

[code:ohsiit4o]import java.io.IOException;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FileUpload {

public static void main(String[] args) throws IOException {
System.setProperty("webdriver.gecko.driver", "C:\\Eclipse\\Drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://www.guru99.com/freelancing.html");
driver.findElement(By.id("theFile_link(Resume)")).click();
//Below line execute the AutoIT script
Runtime.getRuntime().exec(System.getProperty("user.dir")+"\\FileUpload.exe");
driver.close();
}
}[/code:ohsiit4o]

[b:ohsiit4o]I'm Using:[/b:ohsiit4o]

[b:ohsiit4o]Firefox Version:[/b:ohsiit4o] 49.0.1
[b:ohsiit4o]Selenium Version:[/b:ohsiit4o] Version 3.0.0-beta4
[b:ohsiit4o]OS:[/b:ohsiit4o] Win10 64 bit
[b:ohsiit4o]Java:[/b:ohsiit4o] 1.8

M
Replied on 10/10/2016

send a screen shot of inspected elements of the website.