Selenium get all options from drop down in node.jsPut dropdown values in array in JS Node Selenium WebdriverWebdriverIO - Collect drop down elements into an arrayHow do I get started with Node.jsHow do I get the path to the current script with Node.js?How to select/get drop down option in Selenium 2How to get GET (query string) variables in Express.js on Node.js?Unable to get list of drop-down options (objects)How to select option in drop down using CapybaraHow to compare the drop down options is matching with the UI options in Selenium WebDriver?Drop Down in SeleniumPython + Selenium - Select Drop Down Option using Stored VariableHow to loop same code through all options in a drop-down list in Selenium WebDriver using C#

Mute single speaker?

Why does the UK Prime Minister need the permission of Parliament to call a general election?

Is a Wick rotation a change of coordinates?

split a six digits number column into separated columns with one digit

In-universe, why does Doc Brown program the time machine to go to 1955?

Why there are construction cranes on apparently completed buildings in New York?

Global variables and information security

Why did Boris Johnson call for new elections?

Shoes for commuting

Does POSIX guarantee the paths to any standard utilities?

Is there any reason to change the ISO manually?

If I have an accident, should I file a claim with my car insurance company?

Entering the US with dual citizenship but US passport is long expired?

How many people can lift Thor's hammer?

Why are some hotels asking you to book through Booking.com instead of matching the price at the front desk?

Do I have to rename all creatures in a new world?

How do German speakers decide what should be on the left side of the verb?

Is mathematics truth?

What is the majority of the UK Government as of 2019-09-04?

Would you recommend a keyboard for beginners with or without lights in keys for learning?

How does the UK House of Commons think they can prolong the deadline of Brexit?

To which airspace does the border of two adjacent airspaces belong to?

Dissuading my girlfriend from a scam

Why is a pressure canner needed when canning?



Selenium get all options from drop down in node.js


Put dropdown values in array in JS Node Selenium WebdriverWebdriverIO - Collect drop down elements into an arrayHow do I get started with Node.jsHow do I get the path to the current script with Node.js?How to select/get drop down option in Selenium 2How to get GET (query string) variables in Express.js on Node.js?Unable to get list of drop-down options (objects)How to select option in drop down using CapybaraHow to compare the drop down options is matching with the UI options in Selenium WebDriver?Drop Down in SeleniumPython + Selenium - Select Drop Down Option using Stored VariableHow to loop same code through all options in a drop-down list in Selenium WebDriver using C#






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















How can I get all options from drop down using selenium with node.js



below is my code:



var dropdown = driver.findElement(xpath: '//*[@name="dropdownname"]');


from above



var options = dropdown.findElements(tagName: 'option');


how can i get all options and do foreach in node.js or print options values using node.js.



Thanks in advance.










share|improve this question
































    1















    How can I get all options from drop down using selenium with node.js



    below is my code:



    var dropdown = driver.findElement(xpath: '//*[@name="dropdownname"]');


    from above



    var options = dropdown.findElements(tagName: 'option');


    how can i get all options and do foreach in node.js or print options values using node.js.



    Thanks in advance.










    share|improve this question




























      1












      1








      1








      How can I get all options from drop down using selenium with node.js



      below is my code:



      var dropdown = driver.findElement(xpath: '//*[@name="dropdownname"]');


      from above



      var options = dropdown.findElements(tagName: 'option');


      how can i get all options and do foreach in node.js or print options values using node.js.



      Thanks in advance.










      share|improve this question
















      How can I get all options from drop down using selenium with node.js



      below is my code:



      var dropdown = driver.findElement(xpath: '//*[@name="dropdownname"]');


      from above



      var options = dropdown.findElements(tagName: 'option');


      how can i get all options and do foreach in node.js or print options values using node.js.



      Thanks in advance.







      node.js selenium-webdriver






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 19 '16 at 7:52









      Pramod Gharu

      1,1033 gold badges7 silver badges17 bronze badges




      1,1033 gold badges7 silver badges17 bronze badges










      asked Sep 19 '16 at 6:09









      mahesh nanimahesh nani

      163 bronze badges




      163 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          driver.findElement(xpath: '//*[@name="dropdownnamewithoptions"]').then(function(webElement) 
          webElement.findElements(By.tagName('option')).then(function(optionArray)
          if(optionArray.length > 1)
          optionArray[0].getAttribute('value').then(function(optionValue)
          );

          );
          , function(err)
          );





          share|improve this answer

























          • Any ideas on how one might gather the optionValue for each option element in to an array?

            – Unverified Contact
            Mar 28 at 6:42










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39566382%2fselenium-get-all-options-from-drop-down-in-node-js%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1
















          driver.findElement(xpath: '//*[@name="dropdownnamewithoptions"]').then(function(webElement) 
          webElement.findElements(By.tagName('option')).then(function(optionArray)
          if(optionArray.length > 1)
          optionArray[0].getAttribute('value').then(function(optionValue)
          );

          );
          , function(err)
          );





          share|improve this answer

























          • Any ideas on how one might gather the optionValue for each option element in to an array?

            – Unverified Contact
            Mar 28 at 6:42















          1
















          driver.findElement(xpath: '//*[@name="dropdownnamewithoptions"]').then(function(webElement) 
          webElement.findElements(By.tagName('option')).then(function(optionArray)
          if(optionArray.length > 1)
          optionArray[0].getAttribute('value').then(function(optionValue)
          );

          );
          , function(err)
          );





          share|improve this answer

























          • Any ideas on how one might gather the optionValue for each option element in to an array?

            – Unverified Contact
            Mar 28 at 6:42













          1














          1










          1









          driver.findElement(xpath: '//*[@name="dropdownnamewithoptions"]').then(function(webElement) 
          webElement.findElements(By.tagName('option')).then(function(optionArray)
          if(optionArray.length > 1)
          optionArray[0].getAttribute('value').then(function(optionValue)
          );

          );
          , function(err)
          );





          share|improve this answer













          driver.findElement(xpath: '//*[@name="dropdownnamewithoptions"]').then(function(webElement) 
          webElement.findElements(By.tagName('option')).then(function(optionArray)
          if(optionArray.length > 1)
          optionArray[0].getAttribute('value').then(function(optionValue)
          );

          );
          , function(err)
          );






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 22 '16 at 10:57









          mahesh nanimahesh nani

          163 bronze badges




          163 bronze badges















          • Any ideas on how one might gather the optionValue for each option element in to an array?

            – Unverified Contact
            Mar 28 at 6:42

















          • Any ideas on how one might gather the optionValue for each option element in to an array?

            – Unverified Contact
            Mar 28 at 6:42
















          Any ideas on how one might gather the optionValue for each option element in to an array?

          – Unverified Contact
          Mar 28 at 6:42





          Any ideas on how one might gather the optionValue for each option element in to an array?

          – Unverified Contact
          Mar 28 at 6:42








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39566382%2fselenium-get-all-options-from-drop-down-in-node-js%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript