selenium - Can't enter values into second element if two web elements are of same type -


how distinguish between elements of same type, in case, 2 password type elements while using selenium webdriver. in application, not able find elements name or id. used driver.switchto().activeelement().

now, there 2 elements of password types in html , when try access second element, value sent using element2.sendkeys("007") gets entered in element1 field.

in other words, can't access second element @ all!

try below code

list<webelement> element = driver.findelements(by.name('userid')); element.getindex("1").sendkeys("007"); list<webelement> element = driver.findelements(by.name('password')); element.getindex("1").sendkeys("007"); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -