Handle File uploading using Webdriver.

We can handle this using java script or by send sendKeys()function:
 
 
1. Using sendKeys():
 
 WebElement upload = driver.findElement(By.id("fileUp"));
        upload.sendKeys("c:/darkbulb.jpg");
        driver.findElement(By.id("submit")).click(); 
 
2. Using Javascript:
 
 WebElement upload = driver.findElement(By.id("fileUp"));
((JavascriptExecutor)driver).executeScript("arguments[0].style.visibility = 'visible';
 arguments[0].style.height = '1px'; arguments[0].style.width = '1px';
 arguments[0].style.opacity =
 1", upload );

How to handle Javascript alerts and prompts with WebDriver?

Use Alert API for this:
 
 
 Get a handle to the open alert, prompt:
Alert alert = driver.switchTo().alert();
// Get the text of the alert or prompt
alert.getText(); 
 // And acknowledge the alert or click "OK"
alert.accept();
 
//Reject the alert or click "NO" 
alert.reject();

Insert text to elements like Div, Span, p tags etc.... [Webdriver]

If user want to insert text to elements like Div, Span, p tags etc....
Need to insert  "innerHTML" using javascript+Webdriver


driver.get("http://virtualbuffer.blogspot.in/");
           String jScript = "var myList = document.
getElementsByClassName(\"post-header\");"
                    +"myList[0].innerHTML=\"YourNumber\";";
                JavascriptExecutor executor = (JavascriptExecutor)driver;
                executor.executeScript(jScript);

Maven Unable to locate the Javac Compiler in:

It has 4 steps TODO.
Step 1 : Right Click on Eclipse project Properties
Step 2 : Java Build Path >Libraries
Step 3 : Click on JRE > Edit > Installed JRE
Step 4 : Edit Jre > Set JRE Home = JAVA_HOME

Failed to load the JNI shared library jvm.dll


Conbination works perfect:

    32-bit OS - 32-bit JDK - 32-bit Eclipse (32-bit only)
    64-bit OS - 32-bit JDK - 32-bit Eclipse
    64-bit OS - 64-bit JDK - 64bit Eclipse (64-bit only)
If your combination of setup is not correct than this particular error displayed, while launching Eclipse....