--- title: "요소의 텍스트를 가져오기" slug: "getting-an-elements-text" updated: 2025-09-30T06:20:29Z published: 2025-09-30T06:20:29Z canonical: "helpcenter.autify.com/getting-an-elements-text" --- > ## Documentation Index > Fetch the complete documentation index at: https://helpcenter.autify.com/llms.txt > Use this file to discover all available pages before exploring further. # 요소의 텍스트를 가져오기 **Autify Nexus**에는 요소의 텍스트 콘텐츠를 검증하는 [기본 기능이](https://helpcenter.autify.com/docs/ko/getting-an-elements-text-to-use-in-later-steps) 포함되어 있으며, 가능한 한 이 기능을 사용하시는 것을 권장합니다. 표준 검증(assertion) 기능을 사용할 수 없는 경우, 아래의 **Playwright** 코드 스니펫을 우회 방법으로 사용할 수 있습니다. ### 설정 방법 1. 대상 요소의 CSS 선택자(selector)를 가져와 메모합니다. 2. 시나리오에 **Playwright** 코드 스텝을 삽입하고, 다음 스니펫을 해당 스텝에 복사하여 붙여넣으세요. ```typescript // TODO: 이 선택자를 대상 요소의 선택자로 교체해 주세요 const selector = ""; // 요소의 텍스트 콘텐츠를 가져옵니다 // 요소를 찾을 수 없으면 여기에서 테스트가 실패합니다 const text = await page.locator(selector).first().textContent(); return text; ``` 3. 위 스니펫의 `<TODO: REPLACE SELECTOR>`를 1단계에서 메모한 CSS 선택자로 교체하세요.