I'm using robotframework for automating angularjs application.
I have a dropdown with list of states. I need to select 1 of them. Pictures are attached
Values that are available in dropdown
HTML for this
Could anyone help in selecting the value from dropdown?
I tried below
***variables***
${Residential_Address_State} dom = document.getElementById('PD_Me_AddrRes').getElementsByTagName('span')[3]
***test cases***
click element ${Residential_Address_State}
select from list by value ${Residential_Address_State} Victoria
I tried select from list by index and label as well, it didn't work. It clicks on the element, however it doesn't select the list in the dropdown i.e. victoria.
Can anyone please help?
Just click the element that you need
Click Element xpath=//li[text()="Victoria"]
Also, consider using ExtendedSelenium2Library if you haven't already.
Related
I've seen multiple ways involving JS/Jquery that allow enabling a second select element (from a disabled state) once the first select element option has been chosen, but I am wondering if anyone can share how to accomplish this with CSS.
Someone I follow on Twitter posted that there was a way to do it but I can't recall the syntax. Can anyone help?
Image: Area of Issue should be disabled until the How can we help you value has been chosen Currently, the second dropdown has no values in it until the first dropdown value has been chosen.
Let me start off by saying I have very limited knowledge of Javascript.
I've got a Dropdown menu called: CustomerType with 6 values in it.
Basically I just want whatever is selected in the dropdown to display again in another part of the PDF.
Can anyone help?
First set the properties on the dropdown to commit the value immediately. See image.
Then on the "calculate" script for the other field, enter the JavaScript below. You'll need to change the field names to your actual field names.
this.getField("myOtherField").value = this.getField("myDropdown").value;
You'll want to set the other field to read-only as well since the value is calculated.
I've got a checkbox list that I am able to select multiple items at once by using the shift key (click/check an item, shift click/check another item and all items in between are checked). I've got that working (Y)
Checkbox list multi select w/ shift click working
What's next is to try to get the mouse to allow multiple selection via click and drag. You know how you can do this with a basic <select multiple></select> element?
Your basic select multiple element
I would like to be able to do something similar with my checkbox list. Here's my initial attempt, but for some reason, I can't get the ng-mousedown / ng-mouseup to get triggered.
My attempt to get mouse click drag working for select multiple
Any ideas or pointers in the right direction are appreciated.
Edit 1:
I believe I have something working here, but every once in a while, I get the not allowed cursor when trying to drag. Any ideas on the not allowed cursor?
I've got an <mx:Button> in my application, I have 10 items in an XML Node. What I'd like to do is when the button is clicked show the next 5 XML Nodes.
How do I achieve this?
My code is as follows at the mo :
<mx:Button x="1380.65" y="582.65" styleName="rightButton"/>
The style is just setting the up / over and down states of the button. But I want it to function and show the XML nodes in groups of 5.
How are you displaying the first five items?
If you're displaying things in a list or DataGrid, I believe you can set the verticalScrollPosition to scroll the list via a button click.
If you are displaying items using TextInputs, custom component, or other non-renderer-based classes, you just need to manually write some code to update the display elements based on the currently displayed index and what is next.
Can you offer a running sample? That may us direct you!
1) Have a listbox with 3 values out of 5 selected
2) When I click to select another value without holding CTRL button, it will unselect over values
How to make it keep other selected values if new value is selected?
This is going to sound like a snide answer, but I don't mean it that way. I just like to look for the simple solutions rather than the complicated onces.
The easiest way to get a control to have the behavior you want is to use a control that has the behavior that you want, rather than modifying the behavior of an existing control.
That said, if you want a list of items where a user can select a bunch of items off the list, and don't want to have to rely on them holding control, you're using the wrong tool for the job.
Use a CheckBoxList instead of a ListBox. If you want it to be scrollable, then set it in a div of a specific height, and set the style of the div to "overflow: scroll".
If you still want to use a ListBox you should use javascript and for each click event fired, you should check if the clicked element is selected/unselected and act accordingly. It's a little bit tricky but at least it is a solution for your problem.