Selenium didn't find existing element - html

i create app that runs selenium internet explorer webdriver.
the program work fine on my pc but when i trying it with the same driver on other pc
its throws exception on the first element saying that it can't find it.
no frames in this html.
The first thing i checked is html pagesource the difference was:
on my pc:
<input name="cId" tabindex="1" id="CNum" type="text" size="13" maxlength="10" value="" autocomplete="off">
on other pc:
<INPUT tabIndex=2 id=CNum maxLength=10 size=13 name=cId autocomplete="off">
my selenium code:
driver.FindElement(By.Id("CNum")).SendKeys("123");
what can it be (the html source in other computer without type and in many cases without quotes.)
Thank you.

Try with
driver.FindElement(By.name("cId")).SendKeys("123"); or
driver.findelement(by.cssselector("input[name='cId']")).sendkeys("123");

Related

Chrome audit: Form elements do not have associated labels

I'm receiving this error after auditing my product page in Chrome:
Form elements do not have associated labels
Failing Elements
input#quantity_5ce535030e171.input-text.qty.text
input#woocommerce-product-search-field-0.search-field
Labels clearly indicate input tags with for attribute.
Element #1:
<div class="quantity">
<label class="screen-reader-text" for="quantity_5ce535030e171">My product name</label>
<input type="number" id="quantity_5ce535030e171" class="input-text qty text" step="1" min="1" max="" name="quantity" value="1" title="Qty" size="4" inputmode="numeric">
</div>
Element #2:
<form role="search" method="get" class="woocommerce-product-search" action="https://example.com/example-product/">
<label class="screen-reader-text" for="woocommerce-product-search-field-0">Search for:</label>
<input type="search" id="woocommerce-product-search-field-0" class="search-field" placeholder="Search products…" value="" name="s">
<button type="submit" value="Search">Search</button>
<input type="hidden" name="post_type" value="product">
</form>
Is there anything incorrect in html or Chrome gives false errors?
Looks like this was a bug fixed in axe-core 3.2.0 according to this GitHub issue, but the fix is still not incorporated into Lighthouse as of Chrome version 75.0.3770.142.
Lighthouse uses Axe for the accessibility portion of its audit, but you can run Axe as a stand-alone Chrome extension. I ran the stand-alone extension (version 3.8.0 with axe-core 3.2.2) on a site I'm working on that uses visually hidden form labels and it passed; whereas Lighthouse still failed with the error you mentioned. From what I can tell, based on the learn more links from audit results, Lighthouse is using version 3.1 of axe-core.
As long as styles for .screen-reader-text don't use display:none;, visibility: hidden;, or zero out the width or height, it should pass the stand-alone Axe extension audit.

An autocomplete="off" example works, my code autocomplete="off" does not?

I'm trying to resolve a Chrome autocomplete aggravation with my small web based work order form. I have tried to use autocomplete="off" in my html code, it doesn't work. When I 'Inspect' my page code in Chrome it always displays autocomplete="on" with autocomplete="off" or other wrong terms for off.
But this user's autocomplete="off" demo works perfectly for me. What am I missing?
My code:
<input name="contact_first" style="border:1px solid #737373"
class="required" id="contact_first" value="<?php echo
$row_contact['contact_first']; ?>" autocomplete="off" size="25" />
Example working code:
<label for="firstName2">First Name (WITH autocomplete):</label>
<input id="firstName2" name="firstName2" autocomplete="off">
I have actually cut and pasted the jsfiddle example code from the working example to a small test web form of mine, autocomplete does not stop.
This may affect other browsers also, but I use Chrome primarily.
Any advice appreciated.
Try to use autocomplete="new-password" to disable the Chrome auto-fill functionality (different from basic autocomplete).

Simple input form for hotspot xampp

I am using xampp in order to run a server on my computer. I want to setup a simple hotspot with Microsoft miniport adapter, but when people type anything, it redirects them to a page where they enter the password and after that, they can connect to the internet, otherwise they only get redirected to my page.
I will ask for there first name also but I need everything to be read as text and recorded as text (no encryption) so I can easily read who is connected and when.
I intend to use this simple HTML script, but after that I have no idea what the form handler should be and how to record the information as text.
<form action="/action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey"><br>
Password:<br>
<input type="text" name="password" value="Mouse"><br><br>
<input type="submit" value="Submit">
</form>
Link to code

fine uploader - freeform - expression engine

i have a form created in 'freeform' that uses the 'file browse' input to allow people to upload an image file. thing is we'd like to give some feedback to the users regarding how much of the file has uploaded so i thought using 'fine uploader' would be a good start. we're also using 'expression engine' as our CMS.
the thing is i have no idea how to implement 'fine uploader' with 'EE' or 'freeform'. does any one have any tips ? can i wrap fine uploader around the 'input file' tag ? and how can i direct 'fine uploader' to our 'freeform' ee extension ?
any help would be appreciated! :D
thanks!
an example of what we have working at the moment..
{exp:freeform:form
form:name="photocomp"
form_name="photo_contest_2013"
form:id="2"
ajax="no"
error_page="forms/submit_errors"
matching_fields="email"
return="forms/submit_success"
}
<input class="required" type="text" class="input_large" name="first_name" id="first_name" placeholder="First Name">
<input type="file" name="upload_photo_1[0]" id="upload_photo_10" size="40">
<button class="altButton" value="donate" type="submit" name="submit" title="submit">Let's do this!</button>
{/exp:freeform:form}
I'm not sure Fine Uploader will be able to help you here as its not clear how or even if it can be integrated with FreeForm. You will likely need to discuss your requirements with the people at FreeForm. Fine Uploader would need to send the files to FreeForm's server (I assume), and FreeForm would have to respond according to Fine Uploader's defined response convention (e.g. {success: true}).

Firstname and lastname input fields do not populate into the email body

So I'm trying to adventure into the mystical world of windows 8 programming. I noticed I can code an app in HTML5 (COOL!) but I've ran into a bit of a bug in what I've written. There is no purpose to this app (at this time), just a simple form app to collect string value from text boxes, and vomit that into an email draft to prepare for sending.
This is my code:
<form action="MAILTO:email#mail.com" method="post" enctype="text/plain">
First Name: <input type="text" name="firstname" value="Your First Name"/><br />
Last Name: <input type="text" name="lastname" value="Your Last Name"/><br />
<input type="submit" value="send" />
</form>
And when I click submit, it does open the Windows 8 mail app, with the proper sender field populated! However the firstname and lastname strings do not populate into the email body.
Any thoughts? This is all in my default.html file with Visual Studio. Here's a snippet of what I have
Like Muhammad already said, HTML-apps are displayed via internet explorer (or et least it's engine). To avoid this you could use another webbrowser (like Gecko from Firefox) in your app and just put filling in the center of your XAML-app (which is close to HTML btw) and you could use C# which is IMO (looking at the syntax) not only close to Java.
If you are developing for Windows 8, then you are running the Windows 8 operating system and have Internet Explorer 10 by default, which supports HTML5.
I believe the issue may be with your code. Try changing the "post" to "get", and specify the email body. For example, this code works for me to insert the open textarea into the body of the email:
<form action="MAILTO:email#mail.com" method="get" enctype="text/plain">
<br/>
<textarea name=Body></textarea>
<input type="submit" value="send" />
</form>