Python 3.x 使用Selenium单击物料可排序标题

Python 3.x 使用Selenium单击物料可排序标题,python-3.x,angular,selenium,Python 3.x,Angular,Selenium,我正在尝试在Angular应用程序上使用selenium执行一些自动化测试。一个测试涉及单击mat排序标题。我无法找到使用selenium单击标题的方法 单击该表时,该表将正确排序,但无法使用Selenium对该表进行排序 标题 {{row.title}} 尝试以下操作:driver。通过xpath('/ng container[@matColumnDef=“Header”]')查找元素。单击或driver。通过xpath('/table[@mat table]')查找元素。单击@pop:您尝

我正在尝试在Angular应用程序上使用selenium执行一些自动化测试。一个测试涉及单击mat排序标题。我无法找到使用selenium单击标题的方法

单击该表时,该表将正确排序,但无法使用Selenium对该表进行排序


标题
{{row.title}}

尝试以下操作:
driver。通过xpath('/ng container[@matColumnDef=“Header”]')查找元素。单击
driver。通过xpath('/table[@mat table]')查找元素。单击
@pop:您尝试过我的方法吗solution@farhanpirzada我的想法是,我可以通过单击对列进行排序。对于Selenium,我只能使用呈现为html的内容,所以不能使用ng容器。我试图单击一个特定的列,因此单击表不能帮助我对列进行排序。不过谢谢你。