Capybara/Ruby dropdown values selection - ruby

Drop-down values of month selection while registration of a new account in google.
I need to select the value December after I click on the the month field.
This I need in capybara/ruby.
I have used the below code to search month drop-down and click it.
find("#BirthMonth").click
Now the values in drop-down appear in my result but I need to know how to select them.

You can use:
find('#BirthMonth').select(value)

If the select is a real <select> element then
select('December', from: 'BirthMonth')
Should do what you want without worrying about the find and click. If it's a select replacement built from div, ul, li, etc then we'd need you to post an hetml sample

Related

update Select list with two dates

I'm new on apex and I have this basic question.
I have two datepickers and a select list that depends on those datetimepickers. I need to update the query that fills up the Select List when any datetimepickers change. How can I do that?
Navigate to List of values group of properties.
One of them is the Cascading LOV Parent Item(s) property. Enter names of those datepicker items in there, e.g.
:P1_DATE_FROM, :P1_DATE_TO

How to select dynamic value drop down which loads during run time

enter image description hereI am not able to select the dynamic value of the drop down which loads during run time. I tried using Sendkeys to select the values of the drop down however the index position changes when user selects the value.
The UL tags comes and goes off when user clicks on the menu to select value.
I have attached the DOM and drop down details as part the ticket.Ineed to select values in firefox and chrome browsers and able to perform search accordingly.
Also, please find the locator which i have identified for the same.
Try the below one
var ele= element(by.cssContainingText('your locator here', 'Text of the option you want to select'));
For mor info refer https://www.protractortest.org/#/api?view=ProtractorBy.prototype.cssContainingText

Rich Select with different value but same label is not behaving correctly

I have a rich:select dropdown which has different values but some labels are same.
For example:-(A-a,B-b,C-a,D-a)
So whenever, i'm selecting D-a select item, its submitting A-a, i.e. the first select item with same label.
So the functionality is not working porperly.
What could be the solution for this?

Select multi items all at once in Kendo UI Multi-Select?

When use multi-select control in Kendo UI, it seems we have to select items one by one, i.e. click one item, the drop down list will collapse, then we have to click the multi-select control again to select the next item. Is it possible that when drop down list drops, user can select multiple items at the same time, so multiple items can add to the control at the same time, i.e. use CTRL + Mouse to select multiple items?
For example, in the below image, I want to select Nancy and Robert (i.e. use CTRL+MOUSE) and add them to list at the same time. Is it possible?
Thanks
Set autoClose to false:
$("#multiselect").kendoMultiSelect({
autoClose: false
});

How to populate dynamically generated select boxes with ajax

I haven't been able to find a solution for the particular problem I'm having with this project. I need to the following: dynamically add rows to a table that contain two select boxes AND use ajax to auto-populate the select options of the 2nd select box, based on the value of the first select box... in the respective table row (that was dynamically added on the fly by some js).
Still with me?
I can easily populate, dynamically, a select drop-down using ajax/javascript based on the value of the first drop-down, in the first row. I can even populate three or more select boxes in the same row, using ajax/js functions to load each additional select. Yet, this is not my goal.
Here's what I have... My form contains a simple table with 3 columns. First is a checkbox, the second is the "State" select box and the third column is the "City" select box. I have two buttons above the table that allow me to "Add Row" and "Delete Row". Mind you, the first row (which is programmed-in), works perfectly for loading the city names of a state using ajax.
Upon clicking the Add Row button, I'm able to create the second row dynamically, which contains the checkbox, state select and city select fields. The state select is populated based on the innerHTML content of the original column, but the city select is obviously null because it is expecting ajax to fill it. Note: the names and ID names of these fields are iterative... city_id, city_id_1, city_id_2, city_id_3 and so on... so I have that uniqueness to work with.
My problem lies in the fact that when I select a state from the 2nd or 3rd (and so on) rows, only the firstcity select changes. Why? Because the js/ajax processing function says to operate only on the element with name "city_id"!! Which is the name of the city select box in the first row.
I have not (yet) found a way to dynamically pass the name of the element I need updated to the onreadystate ajax function. When I've needed to populate two or three select boxes in a row (same row), I've had to have complementary ajax functions for each drop-down - which are static, mind you... but what if I create the element dynamically?? I can't pre-program that many functions into my page... or must I?
If you have any ideas on how to accomplish this I would be soo damn appreciative!!!
Thanks!
var i=1; // put here the number of the column being added now.
var x=document.getElementById("city_id_"+i);
// populate x

Resources