select value in dynamic dropdown list in robot framework - robotframework

I'm having a problem selecting certain value in a dynamic dropdown list. The scenario is when there is a newly added value on the DDL then my scripts will fail since the xpath position changes once there is new values.[this is the script in selecting the xpath][2]
Thanks in advance!
This is the html source html source of the DDL

Have a look at the documentation: http://robotframework.org/Selenium2Library/Selenium2Library.html
You could try to select an item from the dropdown list by value or label with the keywords:
'Select From List By Label'
'Select From List By Value'

Related

Select field from SQL Datasource in Google App Maker based on drop down value

I am running into an issue where I have 3 SQL Datasources (Employee, Course, Overview).
I have created a page inherited from the Overview Datasource, where i have created a drop down (options based on the Employee Datasource Employee.items.Name._equals, value set to Overview.Item.Name). When i select his name in the drop down, I want to dynamically fill in a text field where it selects the email field from the Employee Datasource based on the person selection in the drop-down.
Is this possible? If so, how do I proceed? If further information is required please feel free to ask.
Based on your comment change the following items around.
Overview Datasource dropdown options:
#datasources.Employee.items
Leave your dropdown value the same for now.
Dropdown onValueChange event:
widget.root.descendants.EmailTextBox.value = newValue.Email;
Observe that the newValue is a built in variable in the widgets API for a dropdown and points to an object of the options datasource, therefore, if your options are #datasources.Employee.items the options are an array of objects that make up all the Employee items and when selecting one option it points to items[index] and then you are able to call your object at index with the name of your object item. So newValue.Email should get the selected Employee email.

Refresh drop down list

I have a drop down list that is populated based on the selected value of another drop down list. The main drop down list is dlJobName. It contains the list of all active jobs. The second drop down list is dlStage. This contains the distinct stage values related to the JobName. Here is the query that populates the dlStage drop down list.
SELECT DISTINCT [AnnotationDate] as Annotation_Date FROM [vw_GridviewSource] WHERE ([Name] = #Name)
In this code the AnnotationDate is not a date field but a text field. #Name is a variable equal to the selected value from the dlJobName list.
Here is my dilemma. When I make a selected_index_change event for the dlJobName, before I update the gridview that uses both of these drop down lists, I need to update the dlStage to only available values. What is happening is the dlStage list is not updated and the values in the drop down list is not available for the new JobName. Is there a way to force the query to run on the dlStage drop down list in conjunction with the selected index change event? This would cause the gridview to at least populate and not error out.
I can provide whatever additional code is necessary.
I think you have not set AutoPostBack="true" of drop down list. If Problem continues please put your HTML and cs code for proper help.
Hi maybe like other user comment you need go to property from dropdownlist, search AutoPostBack and change False for True. Don't forget clean firsr your dropdownlist
DropDownList.Items.Clear() (VB.NET)
DropDownList.Items.Clear(); (C#)
After clean your dropdownlist charge again your method to bind dropdownlist
set the property
dlJobName.AutoPostBack="true"
This will makes the SelectedIndexEvent to fired when the selected index of the main dropdown is changed.
In that selectedIndexChanged Event load the second DropdownList.
Here is an example,
http://asp-net-example.blogspot.in/2009/03/how-to-use-dropdownlist-autopostback.html
Hope your problem solved, if still exists kindly paste your snippet.

jqGrid - multiselect rows and rowselect

I have a jqGrid with multi select set to true using the asp.net jqGrid.
I want it to select multipole rows then click a button and something will apply to the IDs for all those rows. At the same time, clicking on a row should populate some fields (ex. textboxes). The problem is I've used the rowselect method and although that allows me to populate the form on row select it does not allow me to select multiple checkbox rows.
Is there a way to make the checkboxes not activate the rowselect method?
OR is the alternative to create a hyperlink on the result of the value in a cell that calls a method in code behind passing the ID? Is my last idea even possible?
Thanks
In order for checkboxes not to activate the rowselect event , you can use cellselect instead of rowselect function. Under cellselect function , check for column index if its not the checkbox column , then execute the code which you have written for rowselect.
You may need to write client side code [javascript] , you can add
tag [server] and add cellselect option to it . For more information check the link below
http://www.trirand.net/forum/default.aspx?g=posts&t=1452

how to set selected elements in DevExpress' CheckedComboBoxEdit

I'm a newbie for DevExpress controls. I have a DevExpress checkedComboBoxEdit control that is populated by data from SQL Server using Linq. Populating the checkedComboBox elements worked fine but I couldn't figure out how to set the selected elements.
The DB table contains three fields
id (Value Member),
Role (Display Member)
Applies (contains 0 for unselected and 1 for selected)
I want to select the checkbox elements based on the Applies field. How can I do this? Or is there a better way of doing this by modifying the database table? Or is there a CheckedComboBox property to do this?
Thanks
You should find all you need in the DevExpress online doumentation. In particular:
To initialize the check items' values and display text with values of
these fields, assign the names of the fields to the
RepositoryItemCheckedComboBoxEdit.ValueMember and
RepositoryItemCheckedComboBoxEdit.DisplayMember properties.
So in your case, you should assign 'Role' to the DisplayMember property and 'Applies' to the ValueMember property (rather than 'id').
To Unchecked all items in CheckedComboBoxEdit
For i = 0 To CheckedComboBoxEdit1.Properties.Items.Count - 1
clUSER_ID.CheckedComboBoxEdit1.Items.Item(i).CheckState =
CheckState.Unchecked
Next

SSRS SELECT ALL emulation in ASP.NET Dropdown List

I have a multi-value parameter for SSRS report.
This parameter being a multi-select will have SELECT ALL option that selects all values under the drop down list.
Challenge is emulating the same using ASP.NET drop down list as parameter source. I will use reportviewer control just to render and display report but not to show parameters. Parameters come from ASP.NET page. How do I achieve SELECT ALL functionality in this case?
You can achieve this in query to retrieve dummy record and do UNION.
Just do a very simple thing showed below.
Select 0 as ID, "(Show All)" as Name
Union
Select Id, Name from MyTable
You could use a jquery widget to do something like this. For example see Eric Hynds jQuery UI Mutliselect:
http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
It has a 'select all' option

Resources