먼저 Selelnium은 클라이언트 에서 개발자 도구르 사용해서 얻을 수 있는 엘리먼트 분석 기능을 사용할것이다.
개발자 도구의 Inspect element 옵션을 선택하면 Css, XPath를 엍을 수 있다.
- findElement 메소드로 엘리먼트 위치 지정.
| By Id | driver.findElement(By.id(<element ID>)) |
| By name | driver.FindElement(By.Name(<element naem>)) |
| By class name | driver.findElement(By.className(<element class>)) |
| By tag name | driver.findElement(By.tagName(<htmltagname>)) |
| By lint text | driver.findElement(By.linkText(<linktext>)) |
| By partial link ext | driver.findElement(By.partialLinkText(<linktext>) |
| By CSS | driver.findElement(By.cssSelector(<css selector>)) |
'개발 공부' 카테고리의 다른 글
| Selenium 에서의 엘리먼트 위치 지정 NO.3 Ver.Java (여러 엘리먼트 지정 예제) (0) | 2023.06.02 |
|---|---|
| Selenium 에서의 엘리먼트 위치 지정 NO.2 Ver.Java (메소드 예제) (0) | 2023.06.02 |
| Selenium 이란? (0) | 2023.06.02 |
| SpringBoot 프로젝트 생성(intelliJ 유료버전) (0) | 2023.05.31 |
| 오버로딩과 오버라이딩의 차이점 (0) | 2023.05.21 |