tag:blogger.com,1999:blog-4065813838796681997.post1675461891443107560..comments2023-03-28T12:31:44.912-04:00Comments on QA & Testing: Dealing with things that disappear from the DOM when you look at themDarrellhttp://www.blogger.com/profile/18232752184374702137noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4065813838796681997.post-22154128917756712842013-12-16T03:13:50.624-05:002013-12-16T03:13:50.624-05:00I got it,great.I got it,great.Anonymoushttps://www.blogger.com/profile/01800875240365360695noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-33953348484898602272013-12-14T06:58:44.786-05:002013-12-14T06:58:44.786-05:00First, findElement returns one WebElement. You can...First, findElement returns one WebElement. You can sendKeys to one WebElement. If you use findElements it returns a List of WebElement. You can loop over all the WebElement and do sendKeys on each WebElement, e.g.<br /><br />List elements = driver.findElements(By.cssSelector("name$='foo']"));<br />for (WebElement element : elements) {<br /> element.sendKeys("test");<br />}<br /><br />Second, there is no name$. Given "[name$='myTextBox']", name is the attribute, $= is the operator and 'myTextBox' is the value. The $= operator means 'ends-with'.Darrellhttps://www.blogger.com/profile/18232752184374702137noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-59742178068144992892013-12-14T00:35:43.052-05:002013-12-14T00:35:43.052-05:00hi,Darrell:
this article is very insteresting,I...hi,Darrell:<br /> this article is very insteresting,I found you use the method:driver.findElement(By.cssSelector("input[name$='myTextBox']")).sendKeys("test"); firtly,driver.findElements returns an array list,can use sendKeys()?and second,I never see the css selector use like this:input[name$='myTextBox'],can you tell me name$ ,what does this mean?Anonymoushttps://www.blogger.com/profile/01800875240365360695noreply@blogger.com