Unable to turn on Autocomplete On - google-chrome-extension

I've this page and there is an input text element(Enter PNR No):
<input class="form-control_custom input_text_custom" type="text" id="inputPnrNo" maxlength="10" value="" placeholder="Enter PNR No." onkeypress="return ((event.charCode >= 48 && event.charCode <= 57) || event.charCode == 0)" >
I've added autocomplete as in below:
<input class="form-control_custom input_text_custom" type="text" id="inputPnrNo" maxlength="10" value="" placeholder="Enter PNR No." onkeypress="return ((event.charCode >= 48 && event.charCode <= 57) || event.charCode == 0)" autocomplete="on">
But autocomplete is not turning on. What could be the problem?

Related

ElementNotInteractableException while using selenium and python

I am trying to automate login to a website (http://www.primecbdatabase.com/). It's source code is as follows
<p><label for="username">User ID</label> <input type="text" name="user_id" value="" onchange="javascript:replcodeid()"; size="6" maxlength="50"></p>
<p><label for="Password">Password</label><input type="password" name="password" id="password" value="" size="6" onkeypress="return SplChar1(event);" onchange="javascript:replcodepwd()" maxlength="16" ></p>
<p class="btn" style="margin-bottom:0;"><a onmouseover="self.status='PRIME Database';return true" href="javascript:submit1()"><img src="images_NSE/login-btn1.png"></a></p>
<p class="password">Forgot Password?</p>
It works correctly when dealing with the username input as shown below
inputElement = driver.find_element_by_name('user_id')
inputElement.send_keys(username)
But when I am trying to do the same for password (as shown below) it throws the ElementNotInteractableException. Looks like I am having trouble with send_keys to transfer the password to the input box.
inputElement = driver.find_element_by_name('password')
inputElement.send_keys(password)
I tried changing find_element_by_name to find_element_by_id, it still doesn't work. Kindly help me with it.
You need to click on the textbox before type.
driver.find_element_by_id("password").click()
driver.find_element_by_id("password").send_keys("123")
I have tried and am able to type a password using a script.

How to restrict Primefaces inputMask to number and activate the copy and paste

I need to restrict p:inputMask to numbers only and need to activate copy and paste also, this is my code:
<p:inputMask maxlength="18" id="numeroDocumento"
name="numeroDocumento" label="Número de documento"
value="#{dtConsultarInfController.numeroDocumento}"
title="#{pmsg['sif.screen.consultarVerificarInf.label.docNumber']}">
<p:keyFilter regEx="/[\d]/" />
</p:inputMask>
<p:keyFilter for="numeroDocumento" mask="num" preventPaste="false" />
Could somebody help me?
I've added the "onkeypress" to your code, try this now, it will normally restrict typing to numbers only :
<p:inputMask maxlength="18" id="numeroDocumento"
name="numeroDocumento" label="Número de documento"
<p:inputMask maxlength="18" id="numeroDocumento"
name="numeroDocumento" label="Número de documento"
onkeypress="if((event.which < 48 && event.which != 46
&& event.which != 8) || event.which > 57) return false;">
value="#{dtConsultarInfController.numeroDocumento}"
title="#{pmsg['sif.screen.consultarVerificarInf.label.docNumber']}">
<p:keyFilter regEx="/[\d]/" />
</p:inputMask>
<p:keyFilter for="numeroDocumento" mask="num" preventPaste="false" />
value="#{dtConsultarInfController.numeroDocumento}"
title="#{pmsg['sif.screen.consultarVerificarInf.label.docNumber']}">
<p:keyFilter regEx="/[\d]/" />
Thank you very much my friend, your solution admits the dot sign buy I changed the condition on the onkeypress property and it's working successfull!
This is the solution:
<p:inputMask maxlength="18" id="numeroDocumento"
name="numeroDocumento" label="Número de documento"
onkeypress="if((event.which < 48 && event.which != 8) || event.which > 57) return false;" value="# dtConsultarInfController.numeroDocumento}" title="#{pmsg['sif.screen.consultarVerificarInf.label.docNumber']}"></p:inputMask><p:keyFilter for="numeroDocumento" mask="num"preventPaste="false" />

Accessibility issue with p:select

Using primefaces 5.1, i'm testing my app with WCAG validator and the following code is breaking a guideline:
<p:outputLabel for="selectHowMuch" value="Do you feel edgy lately ?" />
<p:selectOneMenu id="selectHowMuch" value="Yes">
<f:selectItem itemLabel="Argggg" itemValue="3" />
<f:selectItem itemLabel="Yes" itemValue="2" />
<f:selectItem itemLabel="hmmm" itemValue="1" />
<f:selectItem itemLabel="NO!" itemValue="0" />
</p:selectOneMenu>
the broken guideline is
Success Criteria 1.3.1 Info and Relationships (A) Check 91: select
element missing an associated label.
Repair: Add a label element that surrounds the control's label. Set
the for attribute on the label element to the same value as the id
attribute of the control. And/or add a title attribute to the input
element. And/or create a label element that contains the input
element.
Error Line 1, Column 16711:
<select id="_testapp_WAR_testapp001SNAPSHOT_:j_idt3:selectHowMuch_input"
Note that the p:outputLabel actually did help (if i remove it, i get more errors), but it looks like it's not covering the <select> _input label
I also noticed that the same happens for other select components.
Any ideas to get around this ?
Edit: here's my generated code:
<label id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:j_idt62" class="ui-outputlabel ui-widget"
for="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_focus">Do you feel edgy lately ?</label>
<div id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch" class="ui-selectonemenu ui-widget ui-state-default ui-corner-all">
<div class="ui-helper-hidden-accessible">
<input
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_focus"
name="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_focus"
type="text" autocomplete="off" />
</div>
<div class="ui-helper-hidden-accessible">
<select
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_input"
name="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_input"
tabindex="-1"><option value="3">Argggg</option>
<option value="2">Yes</option>
<option value="1">hmmm</option>
<option value="0">NO!</option></select>
</div>
<label
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_label"
class="ui-selectonemenu-label ui-inputfield ui-corner-all"> </label>
<div
class="ui-selectonemenu-trigger ui-state-default ui-corner-right">
<span class="ui-icon ui-icon-triangle-1-s ui-c"></span>
</div>
<div
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_panel"
class="ui-selectonemenu-panel ui-widget-content ui-corner-all ui-helper-hidden ui-shadow">
<div class="ui-selectonemenu-items-wrapper"
style="height: auto">
<ul
class="ui-selectonemenu-items ui-selectonemenu-list ui-widget-content ui-widget ui-corner-all ui-helper-reset">
<li
class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all"
data-label="Argggg">Argggg</li>
<li
class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all"
data-label="Yes">Yes</li>
<li
class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all"
data-label="hmmm">hmmm</li>
<li
class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all"
data-label="NO!">NO!</li>
</ul>
</div>
</div>
</div>
<script id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_s"
type="text/javascript">$(function(){PrimeFaces.cw("SelectOneMenu","widget__tutorial_WAR_tutorial001SNAPSHOT__j_idt3_selectHowMuch",{id:"_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch",widgetVar:"widget__tutorial_WAR_tutorial001SNAPSHOT__j_idt3_selectHowMuch"})});</script>
Sorry, i have to contrast with the last answer...
In your example, this select does not have an associated label
<select
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_input"
name="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_input"
tabindex="-1"><option value="3">Argggg</option>
<option value="2">Yes</option>
<option value="1">hmmm</option>
<option value="0">NO!</option></select>
There is one label after it who might have been thought for it, but it does not have a for attribute and does not contain the select tag.
<label
id="_tutorial_WAR_tutorial001SNAPSHOT_:j_idt3:selectHowMuch_label"
class="ui-selectonemenu-label ui-inputfield ui-corner-all"> </label>
As I understand, both the input and the select are generated for this one field and only one label is correctly associated with the input. This looks like a bug in primefaces, and you should ask their staff to make some corrections...
Also there would be more correction to do, because the first label should be associated with the select element, and the input element be invisible to screenreaders if I correctly understand.
There is nothing wrong with your markup per se. It conforms to one of the accepted techniques.
http://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/H44#H44-ex1
Although that example shows use with an <input> element, it is equally valid with a <select> element.
This looks like a bug in your validator. I suggest trying FireEyes http://www.deque.com/products/fireeyes/fireeyes-installation/

aui input field with select dropdown

I have one text file with select dropdown as follows:
<aui:field-wrapper cssClass="with-select">
<aui:input type="text" name="productionCapacityParYear"
label="production.capacity.par.year" inlineLabel="true">
<aui:validator name="required"></aui:validator>
<aui:validator name="number"></aui:validator>
</aui:input>
<aui:select name="productionCapacityParYearUnit" label=""
inlineLabel="true">
<aui:option label="production.units" value="" selected="true"></aui:option>
<aui:option label="selection.ex" value="1"></aui:option>
</aui:select>
</aui:field-wrapper>
But this select field comes in new line, but I want it in same line as the input. How can I do this?
Thanks in advance

Unable to fill values into text box using autoit script with firefox?

i am unable to fill values into text box ?i have tried following code..``
$url = "file:///C:/Users/Desktop/HTML.html"
$formID = ""
$formUID = "username"
$uName = "srv.iloadmin"
$formPID = "password"
$pwd = "SeR^ER#iL0"
$formSubmit = "ID_LOGON"
Run(#ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $url, "", #SW_MAXIMIZE)
_FFSetValue($uName,$formUID,"id")
_FFSetValue($pwd,$formPID,"id")
HTML script username is:
<input autocomplete="off" class="textfield" name="username" id="username" size="30" onkeypress="return checkEnter(event);" type="text">
Password:
<input autocomplete="off" class="textfield" name="password" id="password" size="30" onkeypress="return checkEnter(event);" type="password">
You need to take a closer look at Firefox UDF
Here is a simple example:
#Include <FF.au3>
_FFConnect()
If _FFIsConnected() Then
_FFOpenUrl("http://www.example.com/news/811")
_FFLoadWait()
_FFClick(".forms[2].elements[0]")
_FFLoadWait()
EndIf

Resources