Dropdown selection in IE 11 doesnot work

Ask general questions here.
lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 8:30 am

Dear all,

I have been working on an application which has support only for IE 9. I had used the below customized code for selecting an element from a drop down;
public void SelectfromSelecttag(SelectTag selectTag, string comboItem)
{
try
{
int attemptsToSelect =0;
int maxAttemps = 3;
while(attemptsToSelect != maxAttemps)
{
selectTag.EnsureVisible();
selectTag.Click(Location.CenterRight, 1000);
ListItem item = "/container[@caption='selectbox']/listitem[@text='" + comboItem + "']";
Delay.Milliseconds(1000);
item.Select();
item.MoveTo();
item.Click();
string itemtext = item.Text;
if(itemtext == comboItem)
{
break;
}
else
{
attemptsToSelect++;
}
}

Thread.Sleep(3000);
}
catch (Exception e)
{
Logger.Instance.ErrorLog ("Unable to find Select Item: " + comboItem + e.Message);
}
}
Recently support for IE 11 was added for the application that was automated. When the above code is used for IE 11, the drop down selection is not working and we are getting null value in the below line;
ListItem item = "/container[@caption='selectbox']/listitem[@text='" + comboItem + "']";


My assumption is that may be "selectbox" object is no longer supported in IE 11. Can someone provide a solution for this if they have any?

Thanks

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 8:39 am

Hi,

Please post a Ranorex snapshot (not screenshot) of the element in question, both from IE9 and IE11. Ideally, post also a small HTML sample utilizing the given dropdown.

Without (at least) snapshot, there is not much anyone here can do for you.

Also, you forgot to mention Ranorex version you are using.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 9:43 am

Attached is the snapshots that you had requested for. I am using Ranorex verrsion 5.3.0
Attachments
dropdown_IE11.rxsnp
(143.02 KiB) Downloaded 46 times
dropdown_IE9.rxsnp
(121.82 KiB) Downloaded 25 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 9:50 am

Hi,

I'm afraid, you forgot to attach the snapshot ;) Anyway, 5.3.0 is long time dead and no longer supported version! I would strongly recommend to try latest 6.2.1. Many problems are solved just by upgrading to newer version! Just try it (even in Trial mode) and let us know if upgrade helped. Thanks.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 9:52 am

I have attached both the snapshtos now. I will try upgrading to latest version and let you know the behaviour

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 10:03 am

OK, I now see the attachments, but there is one problem with them. There are no listitems available ;)

You need to save the snapshot using Instant Tracking (Ctrl+Left Win key) while the combo box is expanded.

Simply start Ranorex Spy, then go to your app, expand the combo box, keep mouse over any of the combo box listitems and then press CTRL+Left Win key. This should display list of combobox items in Spy and then you should be able to save the snapshot, including all listitems.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 11:59 am

I tried to save the snapshot using the Instant Tracking method that you suggested and I am getting the below error.

I have got the Snapshot in one instance. Please check if that could be of help.

As per your suggestion, I also upgraded trial version of latest Ranorex and still getting the same error.
Attachments
Error ScreenShot.jpg
Error ScreenShot.jpg (55.75 KiB) Viewed 2775 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 12:26 pm

Honestly, I've most probably never tried to save the snapshot of combo box list items ;) Anyway, I just tried to simulate the combo box (select) element in IE 11 and it seems the Caption 'selectbox' is still available in IE11? So it's most probably not a cause of your problem?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 12:49 pm

I just tried your code (with one small modification) with combo box available here:
https://www.w3schools.com/tags/tryit.as ... tml_select

Instead of SelectTag, I passed the 'select' element as an Adapter (obtained from repository). And for testing purposes, I filled the comboItem with 'Opel' string. The code worked as expected on IE11.

Could you please post exact error you are getting? Also, from where you run the code? Code Module or Recording? How exactly are you calling this method and how do you fill the selectTag?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 1:31 pm

Below is the error that I am getting;

Unable to find Select Item: locationone. No element found for path '/container[@caption='selectbox']/listitem[@text='locationone']' within 10s.

Below is the way i am calling the method;

I have a internal Class named RanorexObjects and I have created all the classes under this internal Class and so I am calling it this way;
RanorexObjects.SelectfromSelectTag(baserepo.ADMINPAGE.Location_dropdown, "locationone")

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Dropdown selection in IE 11 doesnot work

Post by krstcs » Thu Mar 16, 2017 2:37 pm

Have you used Ranorex Spy to make sure that the path hasn't changed from IE 9 to IE 11? Also, make sure that all of your data bindings are correct and that all test data is correct for that case.

To me, it looks like a data issue, not a Ranorex or IE issue.
Shortcuts usually aren't...

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Thu Mar 16, 2017 3:01 pm

No path has changed. I am running the same script in parallel on two different machines containing IE 9 and IE 11 on the same server . The one with IE 9 works absolutely fine whereas the one with IE 11 fails.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dropdown selection in IE 11 doesnot work

Post by odklizec » Thu Mar 16, 2017 3:10 pm

OK, since saving snapshot of combo box items seems does not work, could you please post a screenshot of the Spy after Instant Tracking (both in IE9 and IE11)? If they show the same items and attributes, there should be no reason why your code does not work. But as mentioned, I tried it with IE11 and it works for me? So my guess is, that there is something different on that IE11 machine?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Fri Mar 17, 2017 7:34 am

Thanks for the efforts. Attached are the screenshots and my observation .

The difference between your dropdown list and my dropdown list is that the first value of the dropdown in your case has a value
Dropdown 1.png
Dropdown 1.png (6.32 KiB) Viewed 2743 times
while mine doesn't have a value.
Dropdown 2.png
Dropdown 2.png (17.52 KiB) Viewed 2743 times

That is the reason the same code works fine in your browser. This code works fine in IE 11 if any of the dropdown which does not contain a blank value as the first listitem.

I tried to compare the list and find below the differences

IE 9 Screenshot 1
Dropdown 3.png
Dropdown 3.png (48.11 KiB) Viewed 2743 times
Last edited by lila on Fri Mar 17, 2017 7:37 am, edited 1 time in total.

lila
Posts: 21
Joined: Wed Jun 18, 2014 10:17 am

Re: Dropdown selection in IE 11 doesnot work

Post by lila » Fri Mar 17, 2017 7:37 am

IE 9 Screenshot 2
Dropdown 4.png
Dropdown 4.png (46.05 KiB) Viewed 2743 times
IE 11 Screenshot 1
Content_Editable_Inherit.jpg
Content_Editable_Inherit.jpg (78.03 KiB) Viewed 2743 times
[IE 11 Screenshot 2
Valid_Ture.jpg
Valid_Ture.jpg (64.39 KiB) Viewed 2743 times