Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

Have a suite of web-drivers tests that run in chrome and IE 10, but will not run in IE 11.

The tests fail in IE-11 when clicking a button as the following action (a form popup) does not occur. I cannot repeat this manually and this only seems to happen in IE-11. No exceptions are thrown when finding the button or clicking the button. This is an intermittent error as sometimes the clicking will work and the tests will run.

I can put an explicit wait before the click(s) occur and tests will then run.

The button is always present in the DOM (not added later by javascript).

I have also added a check so that web-driver will not start interacting (clicking) with a page until after all the initial javascript has finished running on the page. This is done by the last piece of javascript setting a flag.

Has anyone had similar issues?

Edit I don't not want to have waits in the test code. Just put them in to debug what was not working

share|improve this question
    
I've found intermittent IE errors are usually page loading (your mileage may vary). If you are using the page object model on the page, can you get the element as an object and verify it before clicking? I've had better success with that than waits. –  MichaelF Aug 20 at 13:05
    
I am using the Page Object Model and capturing the a WebElement before attempting to click it... –  Jon Duffy Aug 20 at 13:09
    
Other than the fragility of IE, if you can't find an obvious error turn up logging and see if you get anything. I've always had IE tests fail and pass on rerun, it's one of the most aggravating parts of Automation that tests will sometimes fail for no obvious reason –  MichaelF Aug 20 at 13:22
1  
I think it might help to read about the differences between IE10 and IE11. msdn.microsoft.com/library/ie/dn384059 This isn't going to be a quick read, but it seems that something in the application is different in the way it is handled between the two and Selenium. You can look up the control usage in IE11 vs. IE10 and see what the differences might be. That's the best path I can think of without using waits...and then you still might end up with a wait as you might not be able to fix the application. –  mutt Aug 20 at 17:03

2 Answers 2

Personally I would put a wait and in the wait try to click and then verify the popup exists, catch the error and try to click and verify again. That way as soon as it's ready it will return and you aren't using a timer. That is good practice anyway to not just wait a specific time, but wait for a particular event to take place and then move on.

c#

WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(time));
    var popupReady = wait.Until(d =>
        {
            try
            {
                 //click the button
                 //interact with Popup
            }
            catch
            {
                return false;
            }
        });
share|improve this answer
    
I see what you mean. Click and see if the popup appears and then if not click again. My worry would then be that it could hide other issues where buttons are not working properly. –  Jon Duffy Aug 21 at 9:44
    
Yes, you would want to put all that in the wait. Possibly log any "known" issues during that...although don't log every time otherwise your log might grow really long. But you can just add whatever is needed to ensure that all the functionality is accurate in the popup execution part. Then go back to regular testing afterwards. I know this works, but you got to make sure all your ducks are in a row. If your are nervous about some specific stuff and would like guidance please update your question with that new information. –  mutt Aug 21 at 12:09
    
So just to clarify, are you suggesting that the tests should try to complete and any 'unusual behaviour' like in the question should be recorded. Perhaps this should be another question but, how and when do you decide to spend time on issues like this that are 'logged' vs developing new tests etc? –  Jon Duffy Aug 21 at 14:58
    
I would ask that as a separate question and provide more specifics to the question. There are tons of variables involved and most will be specific to your test/goals/reports/requirements/etc... In general it is best for a test to do as much as it can do with each run and log/report specific issues as it runs. This will help alot rather than just failing a test for each failure and then having to manually execute to find the problem and fix it. –  mutt Aug 21 at 15:55

I also had the same problem in clicking the segment under a page then on the elements but could not click. I have a solution that worked for me and hope the below answer will work for you as well. Add the code snippet DesiredCapabilities caps = DesiredCapabilities.internetExplorer(); caps.setCapability("ignoreZoomSetting", true);

// Setting attribute nativeEvents to false enable click button in IE
caps.setCapability("nativeEvents",false);
WebDriver driver = new  InternetExplorerDriver(caps);

It will disbale IE browsers native elements. As far as i know ,native elements i.e. disabling java script that usually present on the click events. Try this out and update here if anyody have better suggestions do let me know.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.