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;
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
add a comment |
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
add a comment |
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
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
node.js selenium-webdriver
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
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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)
);
Any ideas on how one might gather theoptionValue
for eachoption
element in to an array?
– Unverified Contact
Mar 28 at 6:42
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
);
Any ideas on how one might gather theoptionValue
for eachoption
element in to an array?
– Unverified Contact
Mar 28 at 6:42
add a comment |
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)
);
Any ideas on how one might gather theoptionValue
for eachoption
element in to an array?
– Unverified Contact
Mar 28 at 6:42
add a comment |
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)
);
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)
);
answered Sep 22 '16 at 10:57
mahesh nanimahesh nani
163 bronze badges
163 bronze badges
Any ideas on how one might gather theoptionValue
for eachoption
element in to an array?
– Unverified Contact
Mar 28 at 6:42
add a comment |
Any ideas on how one might gather theoptionValue
for eachoption
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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