저는 비교를 위해 JSON 데이터를 가져와야하는 각도기 테스트를 수행하고 있습니다. JSONArray의 일부인 콘솔 각도기에서 JSON 데이터 가져 오기
console.log(json.Root.Catalog.ATA_Chapter[index].ATA_Chapter_Title);
, 그것으로 숫자를 인쇄하고,
"ATA_Chapter": [
{
"@id": "01",
"ATA_Chapter_Number": "Chapter 01",
"ATA_Chapter_Title": "General Airplane Description"
},
{
"@id": "02",
"ATA_Chapter_Number": "Chapter 02",
"ATA_Chapter_Title": "Communications"
}]
는 I는 이하의 코드를 사용했는데, 이하
General Airplane Description
Communications
를 도시 되나 각도기주고 오류 :
Message:
Failed: Cannot read property 'ATA_Chapter_Title' of undefined
Pls는 위의 기능을 대신하는 방법으로 JSON에 액세스하려고의
var number;var title ; console.log(json.Root.Catalog.ATA_Chapter[index].ATA_Chapter_Title); number = json.Root.Catalog.ATA_Chapter[index].ATA_Chapter_Number; title = json.Root.Catalog.ATA_Chapter[index].ATA_Chapter_Title; var chapterName = number+" "+title; element.all(by.repeater('chapter in chapters')).filter(function (ele,index) { return ele.getText().then(function(text){ console.log('text'+text); return text === chapterName; }); }).click();
사양 파일을 게시 할 수 있습니까? –
코드를 포맷하여이 중 아무것도 만들 수 없습니까? –
질문을 스펙 코드로 업데이트하십시오. 댓글에서 읽을 수 없습니다. – Gunderson