-3
A
답변
1
요소 (locator) .getText()을 사용하여 요소의 텍스트를 가져올 수 있습니다. 다음 코드 스 니펫을 사용할 수 있습니다.
var targetElement=element(by.css("ul>li:nth-child(5)"));
targetElement.getText().then(function (txt) {
var textToSplit=txt.split(":");
console.log("Text is : "+textToSplit[1]);
});
감사합니다. 그것은 작동합니다 :) – Loc