NoraUi/noraui-archetype

Cannot click on element IEDriverServer

Closed this issue · 9 comments

Hello,

I am fancing on issue when launching IEDriverServer with NoraUI.
We did develop all our tests on chrome driver and now we would like to also deploy those tests on IE Driver.

So first issue was with NoraUI Version 3.2.0, the project only contains IEDriver for 64bit not 32bit and my solution is only looking for 32bit (I don't know if there is way to change this part without breaking everything), so I found online an exe for IE 32bit.

And then I launched the test on my local.
Everything goes well until I have to click on Login button, I don't have any error showing off and the test continues and then failed because the login button was never clicked on.

Gerkhin syntax feature Given I am logged in Workshop manual application.
Java code updateText(this.loginPage.username, "XXXX");
updateText(this.loginPage.password, "XXXX");
clickOn(this.loginPage.signInButton); ==> this part does not happened

Did someone face this kind of issue before ?
And also is there another version of NoraUI that possess IEDriverServer 32bit ?

Many thanks for your help.

Julie

@Julie-Barelier, can you give me more information please?

Your Environment

  • Robot generated by NoraUi Version: V3.2.0
  • NoraUi Version used: V3.2.0
  • Operating System and version: Unix and Windows ??
  • Data input provider: Excel
  • Data output provider: Excel
  • Browser and version: IE 32bit
  • Link to your project or your company: http:// ????

Can you give me your HTML dom (or better a link to your Web app).

Can you give me your java class please?:

??
updateText(this.loginPage.username, "XXXX");
updateText(this.loginPage.password, "XXXX");
clickOn(this.loginPage.signInButton);
??

You may have been validated on the fields before making the button available. In your application, the button must be clickable but an action is blocked by something else (javascript, ...)

For IE32bit sea and wait: NoraUi/NoraUi#112

NB: I see that you pass the passwords in clear, it is possible to encrypt them via the cryptoService service.

Utilities.findElement(loginPage.password).sendKeys(cryptoService.decrypt(password));

@sgrillon14

Environment
Robot generated by NoraUi Version: V3.2.0
NoraUi Version used: V3.2.0
Operating System and version: Windows
Data input provider: Excel
Data output provider: Excel
Browser and version: IE 32bit
link to your Web app =
HTTPS://secure7-qa.volvo.com/K58WEBMR/web/controllerSecured?action=Main
-- But you won't be allowed

Class java is CommonSteps
@given("I am logged in Workshop manual application")
public void checkLogin() throws FailureException {
updateText(this.loginPage.username, "XXXX");
updateText(this.loginPage.password, "XXXX");
clickOn(this.loginPage.signInButton);
if (!this.k58webmrPage.checkPage()) .....

Mostly in this method I just fill the username and password input, click on OK login and then check I end up on the application homepage.

I found this discuss about the same issue with Selenium/IE:
if the capabilities are set incorrectly or if you are using a different screen resolution then 9 times out of 10, it will send the wrong coordinates back to Selenium
SeleniumHQ/selenium#4292
I don't know if it could be the same

Thanks for the password tips

can you give me a part of your .ini file please?

[XXXX_HOME-username]
xpath=//input[@name='user']

[XXXX_HOME-password]
xpath=//input[@name='password']

[XXXX_HOME-signInButton]
xpath=//input[@id='btnLogin']

@Julie-Barelier, please read this : https://stackoverflow.com/questions/44430623/error-on-run-of-noraui-demo-with-internet-explorer

XuClF

I try with a new robot from scratch and I do not reproduce your problem:
image

Leave a message here if this solves your problem. sinom, write me on my mailbox so that I send you my robot.

Unfortunately, I am not able to change this parameters on my laptop - due to security reasons.
So I am not able to change this part.

I will looking into this issue - is it possible to add this IE options (enable protected mode) on DriverFactory ?
Thanks for your help @sgrillon14

Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information).

Solution: To fix this error, we need to enable protected mode for all zones.

Follow the below steps to enable protected mode for all zones.

Open Internet Explorer
Go to Tools menu – Internet Options
Select Security Tab
In Select a zone to view or change security settings choose Internet and select the check box of Enable protected mode (requires restarting Internet Explorer).
Similarly, select the check box of Enable protected mode (requires restarting Internet Explorer) for other three such as Local Intranet, Trusted sites, and Restricted sites.

In IE Option:
https://static.javadoc.io/org.seleniumhq.selenium/selenium-ie-driver/3.9.0/org/openqa/selenium/ie/InternetExplorerDriver.html

INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS
Capability that defines to ignore ot not browser protected mode settings during starting by IEDriverServer.

NoraUi use INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS but not solve your case:
https://github.com/NoraUi/NoraUi/blob/master/src/main/java/com/github/noraui/browser/DriverFactory.java

private WebDriver generateIEDriver() throws TechnicalException {
        final String pathWebdriver = DriverFactory.getPath(Driver.IE);
        if (!new File(pathWebdriver).setExecutable(true)) {
            throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_MESSAGE_WEBDRIVER_SET_EXECUTABLE));
        }
        LOGGER.info("Generating IE driver ({}) ...", pathWebdriver);

        System.setProperty(Driver.IE.getDriverName(), pathWebdriver);

        final InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions();
        internetExplorerOptions.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
        internetExplorerOptions.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);
        internetExplorerOptions.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
        internetExplorerOptions.setCapability(InternetExplorerDriver.NATIVE_EVENTS, false);
        internetExplorerOptions.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);
        internetExplorerOptions.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
        internetExplorerOptions.setCapability("disable-popup-blocking", true);

        setLoggingLevel(internetExplorerOptions);

        // Proxy configuration
        if (Context.getProxy().getProxyType() != ProxyType.UNSPECIFIED && Context.getProxy().getProxyType() != ProxyType.AUTODETECT) {
            internetExplorerOptions.setCapability(CapabilityType.PROXY, Context.getProxy());
        }

        return new InternetExplorerDriver(internetExplorerOptions);
    }

Hi again @sgrillon14

I was able to update protected Mode on IE by going through Group Policy Editor.
But even so, my issue is still there.

I kind of cheated the login part and press manually on Login Button to see how it will react the second steps.
And when I am logged on the homepage application, I asked to click on the first link in the left menu,
but actually with IE the third link in the left menu is clicked and then the other step is failed.

So what I don't understand is what I do not catch an exception with clickOn() method since it looks like IE do not click on the proper button each time ?
And I still don't know how to solve this issue with IE.

Maybe we will stop trying with IE if it takes to much trouble like this.
Thanks for your help

@Julie-Barelier, IE always poses more problems than with chrome. In the future IE will no longer be supported because MicroSoft stops the developments. They will start with chromium as a base.

If you want, you can send me a temporary login/passord on my private mailbox so that I add the click in the VolvoRobot that I have locally.

Just for my curiosity, which country do you work in?

@sgrillon14
Sorry but I am not allowed to give you even a temporary user/password.
I work in Limonest (Sopra Steria) and the client is Volvo.

I wonder if we are not facing security issue between Volvo/IE and NoraUI authorization.
I will also check with our lead tech in Sopra.

Thank you for your help.