0

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.

https://accounts.google.com/signup/v2/webcreateaccount?continue=https%3A%2F%2Fwww.google.de%2F%3Fgws_rd%3Dssl&hl=de&flowName=GlifWebSignIn&flowEntry=SignUp

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.

3
  • Does the element is present inside any frame? Commented May 7, 2018 at 5:33
  • You have spoken about a lot of issues here. Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. Commented May 7, 2018 at 6:10
  • thanks for the note. I have addressed several problems (2) because I do not know if perhaps the one conditional on the other. the main problem is as mentioned in the title, that an existing object is not found or possibly found but is not filled with the send key. If you had an idea, I would be grateful. Commented May 7, 2018 at 9:12

2 Answers 2

0

If you do Web Interface tests with Java + Selenium, I advise you to use the NoraUi Open Source Framework.

This Framework manage IE webdriver, Chrome webdriver and FF webdriver.

Sign up to request clarification or add additional context in comments.

Comments

0

When ran on IE Probably //*[@id="lastName"] doesn't quite give you the exact element you want to work with. Instead when Can you try giving Xpath like below

//*[@id="lastName"]//following-sibling::div"

Comments

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.