I am using nightwatch.js to perform end-to-end testing and have to use a roundabout method for a waitForElementVisible command to work as expected. For example, my code below:
browser.waitForElementVisible(".profile label[for='Admin']") // works
browser.waitForElementVisible(".profile label[for='Admin'] input[id='Admin']") // breaks
For further clarification, I am testing to see if a radio button is visible. The radio button's DOM elements is as such:
<div class='profile'>
<div class='roleSelector'>
<label for="Admin">
<input type="radio" id="Admin" class="Admin">
</label>
</div>
</div>
As far as I know, there is no such specific case.
Did you try using '.profile input[id='Admin']' ?
Hope that serves your purpose at hand.
Related
I am trying to retrieve multiple values from HTML and make use of it using req.body..
I am able to do this via message: req.body.message
<form id="message-form" class="input-group input-group-lg" style="">
<input type="text" name="message" class="form-control" aria-label="Large" aria-describedby="inputGroup-sizing-sm">
<div class="input-group-prepend">
<button class="btn btn-primary">Send</button>
</div>
</form>
However, I would like to retrieve the values from elements that are not inside the e.g <span id="item" style="font-weight:bold"> </span>
The reason is that when I load the page, it renders these values dynamically (retrieved from database). When I want to do a POST, I would like to make use of these values that have been rendered previously.
Is there a way to do this?
Many thanks.
Forms don't submit data that does not appear inside a form control.
So you can either:
Store the data somewhere in the server (such as in a session) where you can read it back on a subsequent request (watch out for race conditions!) or
Put the data in a form control instead of or as well as in the span. (Possibly using a hidden input).
I can't seem to find a way to edit the localised strings using the provided template editor , does anyone have any pointers on this ?
For example if I wanted to change the text 'search products' to something else for example... Where/How can I edit the template and its data ?
Thank you
Le Roi
The ugly way to do this:
Edit the template, remove the
<search-control></search-control>
And add a custom text to the input placeholder
<div>
<form action="/Products" class="pull-right" method="get">
<input type="hidden" name="startEditTemplate" value="ProductList">
<div class="form-group has-feedback">
<input placeholder="My Custom Search products" id="pattern" type="search" class="form-control" name="pattern" spellcheck="false">
<button class="glyphicon glyphicon-search form-control-feedback ap-ininput-button"></button>
</div>
</form>
</div>
The bad part about this is that you are now responsible for updating this piece of code and template.
So this should be pretty simple, I just want to combine a repeating section within a nested form using Formly.
There are examples for doing each of these individually but I cannot find any examples that combine these functions.
Repeating Section
http://jsbin.com/murule/32/edit?js,output
Nested Forms
http://jsbin.com/zaqeke/22/edit?js,output
I would be very appreciative of anyone who could help!
An example would awesome if possible.
Repeating Section is a complex example of Nested Form
You can see in repeatSection.html repeater ng-repeat="element in model[options.key]"
<div class="repeatsection" ng-repeat="element in model[options.key]" ng-init="fields = copyFields(to.fields)">
<formly-form fields="fields"
model="element"
form="form">
</formly-form>
<div style="margin-bottom:20px;">
<button type="button" class="btn btn-sm btn-danger" ng-click="model[options.key].splice($index, 1)"> Remove </button>
</div>
I am creating an Electron project and I am using Bootstrap Fileinput.
<div class="form-group">
<label class="control-label col-xs-3">Folder containing installation/patch scripts</label>
<div class="col-xs-9">
<input id="input-2" name="input2" type="file" class="file" data-show-upload="false" data-show-preview="false" data-show-cancel="false" webkitdirectory>
</div>
</div>
The control is rendered fine and works. The issue is that, as soon as the control is rendered, I can see "0%" above it. No matter what I have tried I cannot remove that. I don't want a progress bar to be visible, the control will work only to locate a folder name, which will then be used for other purposes.
Any ideas why I always see the progress bar?
I found the solution. I had to add the following option in js code when I create fileinput:
layoutTemplates: {progress: ''}
I am trying to configure JMeter test plan and in one of the thread groups, I need to read the displayed security questions and answer them correctly. The user needs to answer 3 questions that will be displayed randomly from the list of 5 that the user selected when setting up his account.
How would I go about this? I can control the same 5 questions for all the users(when registering), but I cannot control the 3 that will be displayed randomly during my test.
Any pointers? Thanks.
EDIT:
The Question1 Value is parsed and the actual question and not the variable as in the original code, this is the response
<div class="aaaaa">
<label class="aaaaa">Question1 Value?</label>
</div>
<div class="aaaaa">
<label class="aaaaa">Question2 Value?</label>
</div>
<div class="aaaaa">
<div class="bbbb">
<input id="answer1" name="answer1" class="aaaaa" type="text" value=""/>
</div>
</div>
<div class="aaaaa">
<div class="bbbb">
<input id="answer2" name="answer2" class="aaaaa" type="text" value=""/>
</div>
</div>
So if I am using IF Controller in the response, how would I form the condition. I need to be able to create 3 if conditions(need to check for possible 3 conditions - q1&q2, q1&q3, q2&q3). Since the questions are displayed as labels, I am not sure how would I put the condition.
Thanks.
General answer would be:
Use Regular Expression Extractor Post Processor to figure out what question(s) is(are) being asked
Use If Controller to execute specific HTTP Request sampler(s) depending on what questions are.