如何为这个带有双引号的特定网络元素编写 xpath?

How to write xpath for this particular webelement which has a double quotes?

我确定了一个独特的网络元素为:

ng-click="navigateToNewCustomer('New Customer')"

如何为此编写 xpath?当我写 xpath 时它会抛出错误,因为我使用的是双引号。

//*[@ng-click="navigateToNewCustomer('New Customer')"].click();

您可以使用反斜杠转义双引号:
//*[@ng-click=\"navigateToNewCustomer('New Customer')\"].click();