It is not possible to select a select option












0















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!










share|improve this question




















  • 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
















0















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!










share|improve this question




















  • 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














0












0








0


1






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!










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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














  • 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








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












1 Answer
1






active

oldest

votes


















0














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





share|improve this answer
























  • 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











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%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









0














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





share|improve this answer
























  • 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
















0














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





share|improve this answer
























  • 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














0












0








0







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





share|improve this answer













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






share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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


















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%2f53958792%2fit-is-not-possible-to-select-a-select-option%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

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'