I am attempting to create a performance test to capture login and order status from my site. The recording is simply a login page and click a radio button to populate some data. So on initial record with one user, the test works fine. However, when I add a data source with multiple users, I get a postback error on the last page which populates my results. My details just say
500 internal server error
I have a parameter called UnitMemberList which contains the results from the radio button. The response looks like this:
<select name="Ti2$P$content$content$unitMemberList" id="Ti2_P_content_content_unitMemberList" style="width:350px;">
<option value="23505183">100690 - Paula</option>
<option value="10008483633">L76753 - VICTORIA</option>
<option value="10001974885">F55115 - Esther</option>
<option value="10008313924">K86743 - LUCIA</option>
<option value="10007718454">I68327 - GUADALUPE</option>
<option value="10009940400">U99948 - MARIA SONIA</option>
<option value="10008115322">K17051 - MARICELA</option>
<option value="10009928413">U95563 - DANIELA</option>
<option value="10010367156">W65214 - MACRINA</option>
<option value="10000893346">A78549 - Erendira</option>
<option value="10007569390">I13064 - MARIANA</option>
<option value="10001326244">C70591 - Lidia</option>
</select>
Is there a way to just capture the contents of the option values? Everything from option to /option? I can't extract by option value= as there are several of these throughout the response. Also, on the first run, the captured content is just the first number 23505183 and that is stored for the parameter UnitMemberList.
I figured it out. I had more than one match from my response. I changed my regex to use a digit match instead of character.
Related
I am trying to make a stock trading webapp using ASP.Net Core MVC One of the things I am trying to implement is auto-complete search box where you can type the name of a stock and it would be suggested to the user. I tried to use a datalist. I want to use a dictionary where the name of the stock is the key and the value would be the symbol. example key- Apple value-AAPL. When the name is selected, I am trying to use the symbol to call other data from an API elsewhere in the app.
The 2 things I am trying to figure out is
A. Can I implement a dictionary with a datalist to accomplish this?
B. Is there a way to use a database to accomplish this? There are several thousand Stocks and Stock symbols and hard coding them would be very cumbersome and time consuming and would be easier to copy and paste stock names and corresponding symbols into a database.
Thanks in advance. This is my first time posting.
Here is what I have so far. Not sure how to proceed or if this is possible.
<form>
<label for="stock">Choose a Stock:</label>
<input list="stock" name="stock" id="stock">
<datalist id="stock">
<option value="Tesla"/>
<option value="IBM"/>
<option value="Microsoft"/>
<option value="Apple"/>
<option value="Amazon"/>
</datalist>
<input type="submit">
</form>
I have a multiple option select and everytime i submit the page i get:
ERR-1002 Unable to find item ID for item "clients1" in application
for day in {something}
htp.p('<select class="custom-select" name="clients'||to_char(day+1)||'" id="clients'||to_char(day+1)||'" multiple>
<option selected>Open this select menu</option>');
for client in (SELECT id, name FROM client) loop
htp.p('<option value="'|| client.id ||'">'|| client.name ||'</option>');
end loop;
htp.p('</select></div></div></div>');
Looks like this :
<select class="custom-select" name="clients1" id="clients1" multiple=""><option selected="">Open this select menu</option>
<option value="1">Test</option>
...
</select>
I really can't find the problem. Tried to search for an answer but could not find anything.
Thanks in advance
APEX assumes that a form element such as a select list is an APEX page item if its name and id are the same, which yours are. So you can avoid this problem by making the names different from the IDs in some way.
The usual way to create bespoke form elements on an APEX page is to use the APEX_ITEM package, which has functions like SELECT_LIST_FROM_QUERY to generate form elements whose values can be accessed from PL/SQL after page submit via APEX_APPLICATION arrays.
I have this code
<select ng-model='item.data.choice' >
<option ng-if='item.data.simple_allow_blank == false' ng-show='choice.name' ng-repeat='choice in item.data.simple_choices' value="{{choice.name}}" ng-disabled="$parent.controllerAction == 'show'">{{choice.name}}</option>
</select>
It shows the 3 choices entered by the Admin of the system in a dropdown box. It shows it without the blank choice.
The problem is if I want to put a default value (for example, choice[0]), it adds a blank value.
Also when converting from ng-repeat to ng-options from this question.
I have 4 choices 1,2,3 and blank i wanted to remove the blank i followed the guide/answers found on the link i have posted with my question, the difference in my part is that i have a dynamic list and when the list is newly created. it never fails to include the blank when using ng-option but it solves my problem to have an initial default value from the dynamic list, if i use ng-repeat i dont have the initial value but the blank from the choices where remove. i wanted to have the blank choice remove and the same time to have an initial value from the dynamic list.
I can set the default value but it cannot remove the blank option.
Can anyone help? Thanks.
You have to filter data in js file and create a new array that you will render it in html.let say you are getting data in variable **item.data.simple_choices**(as you have written it in ng-repeat)then your function would be.
var data = item.data.simple_choices;
var filteredArray = [];
data.filter(function(item){
if(item.name!=''){
filteredArray.push(item)
}
})
After hours of leeching the web and lots of trial and error I finally got the correct answer.
<select ng-model='model'>
<!-- correct binding -->
<option ng-show='choice.name' ng-repeat='choice in object' value="{{choice.name}}" ng-selected='model = object[0].name'>{{choice.name}}</option>
</select>
The code is simple but this format is helpful because object is an object the has the value of the list. as you can see i did assign it to the model because model is the variable that is being used in the view. The [0] is the index number of the list. You can use value or name depending on what parameters are present on the object.
I am trying to choose a option by Robot Framework native Keyword "Select From List" command, however it is failed with error message :
html page source:
<select id="reason" placeholder="Please select" style="width: 100%; display: none;" class="m-b-xs" data-role="combobox" aria-disabled="false" aria-readonly="false">
<option value="a">Assume</option>
<option value="b">New</option>
<option value="c">Renew</option>
<option value="d">Purchase</option>
<option value="e">Refinance</option>
<option value="f">Reschedul</option>
<option selected="selected" value="New">New</option>
</select>
I used value "Assume" or "a":
Choose Application Reason
Select From List xpath=//select[#id="reason"] Assume
Test was failed with error message:
INFO : Selecting option(s) 'Assume' from list
'xpath=//select[#id="reason"]'.
.....
FAIL :ValueError: Option 'Assume' not in list 'xpath=//select[#id="reason"]'.
INFO : Selecting option(s) 'a' from list 'xpath=//select[#id="reason"]'.
.....
FAIL : ValueError: Option 'a' not in list 'xpath=//select[#id="reason"]'.
But if I replace value "Assume" with default vale "New":
Choose Application Reason
Select From List xpath=//select[#id="reason"] New
test was passed.
Can anyone do the help? Thanks ahead.
I had similar issues with select drop downs and i tried this and worked for me.
click element xpath=//select[#id="reason"]
wait until element is visible xpath=//option[contains(text(),'${label}')]
click element xpath=//option[contains(text(),'${label}')]
If you want to select any static value form the list.
click element xpath=//select[#id="reason"]
click element xpath=//select/option[0]
You can also use text equal,
click element xpath=//option[text()='${label}')]
To ignore blank,
click element xpath=//option[normalize-space(text())='Assume']
I guess it worked as New is a default option.
For me keyword "Select from List by Value" works better.
Try:
Select From List by Value xpath=//select[#id="reason"] a
If it doesn't work - I used to have an error with an element state - add Click Element before selecting from list:
Click Element xpath=//select[#id="reason"]
Select From List by Value xpath=//select[#id="reason"] a
Other alternative by using Index
Select From List By Index xpath=//select[#id="reason"] 1
when you want to value a,
I solved the problem this way.
***Keywords***
Select By Value
[Arguments] ${locator} ${value}
Page Should Contain Element ${locator} 10
Select From List By Value ${locator} ${value}
List Selection Should Be ${locator} ${value}
Active time,
***Test Case ***
Choose Application Reason
Select By Value reason a
should use Label, which means text
e.g.
Select From List By Label xpath=//select[#id="reason"] Assume
I think you should select by value :
select from list by value xpath=//select[#id="reason"] a
I hope someone is able to help me. I am trying to determine whether or not Selenium IDE can verify that only specific values are present in a drop down list, and should anything else appear within the drop down list it is an error.
For example, using a basic html Single Select drop down list :
<select id="drop_down_list">
<option value="Test">Please select...</option>
<option value="Saab">Saab</option>
<option value="Mercedes">Mercedes</option>
<option value="Audi">Audi</option>
</select>
I know I can verify the 'Label' of each selectable value using (for example) :
verifySelectedLabel : //select[#id='drop_down_list'] : Please select...
I know I can verify the 'Value' of each selectable value using (for example):
verifySelectedValue : //select[#id='drop_down_list'] : Test
And I know I can do this for each other selectable value displayed.
But what if for whatever crazy scenario, a Dev decided to add 'Ford' to the drop down list, and he/she did not make anyone aware of this ? My tests would pass as those selectable values which I am expecting are still present.
Is there is a way of verifying that no other values other than those I am expecting are also contained within the drop down list ?
I know there is 'verifyNotSelectedLabel' and 'verifyNotSelectedValue' available for use, and these work perfectly when I can specify the 'Labels' and 'Values' accordingly, but they dont help in this particular scenario.
Fingers crossed someone can help, many thanks in advance to all,
How about using "verifySelectOptions", this will check all the options in the dropdown exactly how it should appear.
So in case if there is a New value added or some changes in the existing values (like spelling mistake etc) Step will fail.
If you right click on the dropdown list while in Selenium-IDE, try choosing verifyTextPresent from the command list. The value will be a text list of all the options in the list strung together(usually with spaces between).
Then if a developer adds a selection(or misspells an existing selection, the step will fail(you could use assertTextPresent if you want the test to stop at that point).
Klendathu