I'm having trouble locating an element. I'm trying to locate it and enter some data into the field. I notice that the class name has spaces and ID is generated automatically (compare these to other forms) so can't use the ID for the automation as I want to automate this to create new forms and will be using the 'Description' field every time.
Below is the html for the Description field, which I'm trying to locate.
<input size="15" maxlength="255" class="acitem description s-description ui-autocomplete-input" spinner="/assets/spinner-48c6e73f2bbe9ea753f7f8e5410541a8138d19d657ddd532b2765335ed3d62bf.gif" auto_complete="true" data-autocomplete-url="/items/auto_complete" data-autocomplete-renderer="item_autocomplete_renderer" data-autocomplete-delay="250" type="text" name="invoice[invoice_lines_attributes][68345][description]" id="invoice_invoice_lines_attributes_68345_description" autocomplete="off">
The codes that I'm using so far has failed.
test_1 = driver.find_element_by_css_selector('.acitem.description.s-description.ui-autocomplete-input')
test_1.send_keys("HELLO WORLD")
test_2 = driver.find_element_by_css_selector("input[class='acitem description s-description ui-autocomplete-input']")
test_2.send_keys("HELLO WORLD")
test_3 = Select(driver.find_element_by_xpath("//*[@class='acitem description s-description ui-autocomplete-input']"))
test_3.send_keys("HELLO WORLD")
Did I got the code wrong or is there some workaround with the class name that has spaces? Thanks.
selectelement