Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
508 views
in Technique[技术] by (71.8m points)

typescript - 单击跨度不带表格单元格不起作用-量角器/打字稿(Click on Span withing table cell doesn't work- Protractor/Typescript)

Click on Span Selement withing Grid cell is not working.

(单击Span Selement withing Grid单元不起作用。)

I tried with actions and below code, both did not work.

(我尝试了操作,并在下面的代码下都无法正常工作。)

Please advise.

(请指教。)

async SaveorCancelRow() {
    var table = this.component;
    var tbody = table.element(by.xpath(".//tbody"));
    var trs = tbody.all(by.tagName("tr")).get(1);

    //Click Save tr[@class='SearchResultItemView customGridHighlight']//td[3]
    await trs
      .element(by.xpath('.//td[3]//span[contains(@class, "save")]'))
      .click()
      .then(function() {
        browser.sleep(5000);
      });
  }
}
  ask by Shreyas Murali translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try below simplified code.

(请尝试下面的简化代码。)

async SaveorCancelRow() {
    await this.component
             .element(by.css('tbody > tr.SearchResultItemView > td > span.save'))
             .click()

    return await browser.sleep(5000);
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...