It is not possible to select a select option
I'm trying to select a value from my select field:
<select class="form-control select required chosen-select" name="shopping_cart[kind]" id="shopping_cart_kind" style="display: none;">
<option value="">Selecione</option>
<option value="pdc">PDC</option>
<option value="normal">Cotação Normal</option>
<option value="emergency">Cotação Emergencial</option>
<option value="contract">Cotação para Contrato</option>
<option value="price_research">Pesquisa de Preço</option>
<option value="legal_purchase">Compra Judicial</option>
<option value="bidding_exemption">Dispensa de Licitação</option>
<option value="scheduled_delivery">Cotação para entrega programada</option></select>
In my code I'm trying to set the second option:
@type = @browser.select_list(id: "shopping_cart_kind")
@type.select 'PDC'
And I have received this error:
timed out after 30 seconds, waiting for {:id=>"shopping_cart_kind", :tag_name=>"select"} to become present (Watir::Wait::TimeoutError)
I've tried the following alternatives and they did not work:
Click element via javascript:
@browser.execute_script( "return arguments[0].click();", browser.link(:id => 'shopping_cart_kind')
Select by index:
@browser.select_list(id: "shopping_cart_kind", index: 1).select ("PDC")
@browser.select_list(id: "shopping_cart_kind").option[1].select
Nothing worked!
watir ruby-watir
add a comment |
I'm trying to select a value from my select field:
<select class="form-control select required chosen-select" name="shopping_cart[kind]" id="shopping_cart_kind" style="display: none;">
<option value="">Selecione</option>
<option value="pdc">PDC</option>
<option value="normal">Cotação Normal</option>
<option value="emergency">Cotação Emergencial</option>
<option value="contract">Cotação para Contrato</option>
<option value="price_research">Pesquisa de Preço</option>
<option value="legal_purchase">Compra Judicial</option>
<option value="bidding_exemption">Dispensa de Licitação</option>
<option value="scheduled_delivery">Cotação para entrega programada</option></select>
In my code I'm trying to set the second option:
@type = @browser.select_list(id: "shopping_cart_kind")
@type.select 'PDC'
And I have received this error:
timed out after 30 seconds, waiting for {:id=>"shopping_cart_kind", :tag_name=>"select"} to become present (Watir::Wait::TimeoutError)
I've tried the following alternatives and they did not work:
Click element via javascript:
@browser.execute_script( "return arguments[0].click();", browser.link(:id => 'shopping_cart_kind')
Select by index:
@browser.select_list(id: "shopping_cart_kind", index: 1).select ("PDC")
@browser.select_list(id: "shopping_cart_kind").option[1].select
Nothing worked!
watir ruby-watir
1
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
1
The select list hasstyle="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.
– Justin Ko
Dec 28 '18 at 16:28
add a comment |
I'm trying to select a value from my select field:
<select class="form-control select required chosen-select" name="shopping_cart[kind]" id="shopping_cart_kind" style="display: none;">
<option value="">Selecione</option>
<option value="pdc">PDC</option>
<option value="normal">Cotação Normal</option>
<option value="emergency">Cotação Emergencial</option>
<option value="contract">Cotação para Contrato</option>
<option value="price_research">Pesquisa de Preço</option>
<option value="legal_purchase">Compra Judicial</option>
<option value="bidding_exemption">Dispensa de Licitação</option>
<option value="scheduled_delivery">Cotação para entrega programada</option></select>
In my code I'm trying to set the second option:
@type = @browser.select_list(id: "shopping_cart_kind")
@type.select 'PDC'
And I have received this error:
timed out after 30 seconds, waiting for {:id=>"shopping_cart_kind", :tag_name=>"select"} to become present (Watir::Wait::TimeoutError)
I've tried the following alternatives and they did not work:
Click element via javascript:
@browser.execute_script( "return arguments[0].click();", browser.link(:id => 'shopping_cart_kind')
Select by index:
@browser.select_list(id: "shopping_cart_kind", index: 1).select ("PDC")
@browser.select_list(id: "shopping_cart_kind").option[1].select
Nothing worked!
watir ruby-watir
I'm trying to select a value from my select field:
<select class="form-control select required chosen-select" name="shopping_cart[kind]" id="shopping_cart_kind" style="display: none;">
<option value="">Selecione</option>
<option value="pdc">PDC</option>
<option value="normal">Cotação Normal</option>
<option value="emergency">Cotação Emergencial</option>
<option value="contract">Cotação para Contrato</option>
<option value="price_research">Pesquisa de Preço</option>
<option value="legal_purchase">Compra Judicial</option>
<option value="bidding_exemption">Dispensa de Licitação</option>
<option value="scheduled_delivery">Cotação para entrega programada</option></select>
In my code I'm trying to set the second option:
@type = @browser.select_list(id: "shopping_cart_kind")
@type.select 'PDC'
And I have received this error:
timed out after 30 seconds, waiting for {:id=>"shopping_cart_kind", :tag_name=>"select"} to become present (Watir::Wait::TimeoutError)
I've tried the following alternatives and they did not work:
Click element via javascript:
@browser.execute_script( "return arguments[0].click();", browser.link(:id => 'shopping_cart_kind')
Select by index:
@browser.select_list(id: "shopping_cart_kind", index: 1).select ("PDC")
@browser.select_list(id: "shopping_cart_kind").option[1].select
Nothing worked!
watir ruby-watir
watir ruby-watir
edited Dec 28 '18 at 18:56
orde
4,69762432
4,69762432
asked Dec 28 '18 at 12:40
LivysonLivyson
1
1
1
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
1
The select list hasstyle="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.
– Justin Ko
Dec 28 '18 at 16:28
add a comment |
1
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
1
The select list hasstyle="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.
– Justin Ko
Dec 28 '18 at 16:28
1
1
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
1
1
The select list has
style="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.– Justin Ko
Dec 28 '18 at 16:28
The select list has
style="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.– Justin Ko
Dec 28 '18 at 16:28
add a comment |
1 Answer
1
active
oldest
votes
Can you please try this code and let me know whether it works?
@type = @browser.select_list(id: "shopping_cart_kind")
@type.option(text: 'PDC').select
I had tried it and received the error:2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present
– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
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%2f53958792%2fit-is-not-possible-to-select-a-select-option%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
Can you please try this code and let me know whether it works?
@type = @browser.select_list(id: "shopping_cart_kind")
@type.option(text: 'PDC').select
I had tried it and received the error:2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present
– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
add a comment |
Can you please try this code and let me know whether it works?
@type = @browser.select_list(id: "shopping_cart_kind")
@type.option(text: 'PDC').select
I had tried it and received the error:2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present
– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
add a comment |
Can you please try this code and let me know whether it works?
@type = @browser.select_list(id: "shopping_cart_kind")
@type.option(text: 'PDC').select
Can you please try this code and let me know whether it works?
@type = @browser.select_list(id: "shopping_cart_kind")
@type.option(text: 'PDC').select
answered Dec 28 '18 at 14:06
RajagopalanRajagopalan
1,5062314
1,5062314
I had tried it and received the error:2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present
– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
add a comment |
I had tried it and received the error:2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present
– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
I had tried it and received the error:
2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present– Livyson
Dec 28 '18 at 16:04
I had tried it and received the error:
2018-12-28 14:02:02 WARN Watir [DEPRECATION] ["until", "timeout_arguments"] Using arguments for Wait#until is deprecated. Use keywords instead. And I fill the quotation required fields # features/step_definitions/create_quotation.rb:5 element located, but timed out after 30 seconds, waiting for #<Watir::Option: located: true; {:id=>"shopping_cart_kind", :tag_name=>"select"} --> {:text=>"PDC", :tag_name=>"option"}> to be present– Livyson
Dec 28 '18 at 16:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
Then your option is not visible, you don't have any problem when you choose the option manually?
– Rajagopalan
Dec 28 '18 at 17:04
add a comment |
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%2f53958792%2fit-is-not-possible-to-select-a-select-option%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
1
Something is indicating that the Select List is not displayed on the page. Can you verify what version of Watir you are using?
– titusfortner
Dec 28 '18 at 13:33
1
The select list has
style="display: none;", which is why Watir is timing out waiting for it to be present. Are you sure that users directly interact with that select list? A lot of pages have custom dropdown looking controls that are actually links/divs/etc. While the custom control might populate the select list eventually, it's not what the user interacts with and is therefore not what Watir can interact with.– Justin Ko
Dec 28 '18 at 16:28