Forum Discussion

haseeb_saleem's avatar
haseeb_saleem
Regular Visitor
6 years ago

Option keyword is not working on firfox using Jscript for web automation

Hi Team,

 

I am unable to use the option keyword while getting all the values of dropdown in firefox. Is there any other way to get all the dropdown value ?

 

Example:
if (desiredObject.Exists) {
Log.Message("Dropdown list Found");
var opts = desiredObject.options;     // This line on working of IE but not for Firefox
for (i = 0; i < opts.length; i++) {
ddlArray[i] = opts.options[i].value;

}

 

Thank You.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    One of the things to realize is that not all properties, etc., translate from one browser to another.  So, what might work in IE might not work in firefox.

    Not knowing the control you're using, I can't tell you what property to use.  You might want to look for something like wItemList or something like that.  It would allow us to help you more if you could take a screenshot of the object in question in your Object Browser so we can see what properties are available.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi haseeb_saleem,

     

    Try using Object Spy to identify the property you can use to get the content. For web controls, there should be many options, innerHTML, contetnText, etc.