After my problem was solved yesterday (see link below), new problems have opened up. First, the solution to the above problem works only for the IE. When I try chrome or firefox with the same code to feed (except, of course, the driver) I get back the error message as at the beginning (before I downgraded the IEDriverServer). see link.
Eclipse Java Selenium failed to connect to localhost
Secondly. does not happen when I use the findelement function. Error message "unable to find e lement". however, this element is there. here the page that should be controlled.
this problem is already frequently requested but unfortunately the answers do not help me. one solution was (as the findelement is faster than the browser) to install the following delay. driver.manage (). timeouts (). implicitlyWait (5, TimeUnit.SECONDS);
another solution was to search for id or xpath instead of name (that's why name and id are listed below as findelement). so far without success. none of the mentioned keys is entered in a field (password and first name, etc., I have already tried).
Here are the articles that come closest to my problem but have not helped me. No such element exception | Internet explorer.
Same CSS Slector Not Working in Internet Explorer but works in firefox
anyway. the IE will open, but no other browser and no element will be filled. here code and error message.
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.grid.selenium.*;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.TimeUnit;
public class firefoxöffner {
public static void main(String[] args) throws IOException, URISyntaxException {
System.setProperty("webdriver.gecko.driver","./geckodriver");
String service = "D://IEDriverServer.exe";
System.setProperty("webdriver.ie.driver", service);
InternetExplorerDriver driver = new InternetExplorerDriver();
driver.get("https://accounts.google.com/signup/v2/webcreateaccount?flowName=GlifWebSignIn&flowEntry=SignUp");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement myDynamicElement = driver.findElement(By.id("lastName"));
driver.findElement(By.id("lastName")).sendKeys("B");
driver.findElement(By.name("lastName")).sendKeys("A");
}
}
Started InternetExplorerDriver server (64-bit) 3.8.0.0 Listening on port 47620 Only local connections are allowed Mai 06, 2018 11:29:28 NACHM. org.openqa.selenium.remote.ProtocolHandshake createSession INFORMATION: Detected dialect: W3C Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with css selector == #lastName
Thanks again.