As per the documentation, I see that SelendroidDriver requires two arguments to be passed. I am not sure if I have got confused, but the editor is simply not allowing me to add just driver = new SelendroidDriver(capa); When I mouse hover on the code, I see this message, "The constructor SelendroidDriver(SelendroidCapabilities) is undefined 1 fix available Add argument to match "SelendroidDriver(URL, capabilities)
Can someone please clarify?
Check the Constructor Summary section in the above link. SelendroidDriver class can take two arguments. I am totally confused now! Constructor Summary SelendroidDriver(org.openqa.selenium.Capabilities caps) SelendroidDriver(URL url, org.openqa.selenium.Capabilities caps)
Here is my full code,
import java.util.concurrent.TimeUnit;
import junit.framework.Assert;
import io.selendroid.SelendroidDriver;
import io.selendroid.common.SelendroidCapabilities;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class TestClass1 {
public static void main(String[] args) throws Exception{
try{
SelendroidCapabilities capa = new SelendroidCapabilities("io.selendroid.testapp:0.14.0");
WebDriver driver = new SelendroidDriver("http://localhost:4444/wd/hub/status", capa);
WebElement inputField = driver.findElement(By.id("my_text_field"));
inputField.sendKeys("Selendroid");
driver.quit();
}
catch(Exception E)
{
throw E;
}
}
}