nightwatch-chrome-recorder icon indicating copy to clipboard operation
nightwatch-chrome-recorder copied to clipboard

Add support for text and xpath selector

Open jecfish opened this issue 2 years ago • 3 comments

DevTools Recorder support text and XPath selector from Chrome 108 onwards. I am wondering if there are similar selector in Nightwatch?

Here is the example step's json.

{
      "type": "click",
      "target": "main",
      "selectors": [
        [
          "aria/Proceed to checkout"
        ],
        [
          "[data-test=checkout]"
        ],
        [
          "xpath///*[@data-test=\"checkout\"]"
        ],
        [
          "text/Total: $0.00"
        ]
      ]
    }
Screen Shot 2022-10-16 at 9 35 19 AM

jecfish avatar Oct 16 '22 07:10 jecfish

That's awesome! We do have xPath, but I was wondering which selector should be given preference since we have four selectors and officially, w3c only support xPath and css selector, so what should be the order? Also, do users have options to only prefer the xPath or text selector?

vaibhavsingh97 avatar Oct 20 '22 06:10 vaibhavsingh97

/


Gahona47 avatar Oct 02 '23 18:10 Gahona47

``

DevTools Recorder support text and XPath selector from Chrome 108 onwards. I am wondering if there are similar selector in Nightwatch?

Here is the example step's json.

{
      "type": "click",
      "target": "main",
      "selectors": [
        [
          "aria/Proceed to chend

eckout"

    ],
    [
      "[data-test=checkout]"
    ],
    [
      "xpath///*[@data-test=\"checkout\"]"
    ],
    [
      "text/Total: $0.00"
    ]
  ]
}

<img alt="Screen Shot 2022-10-16 at 9 35 19 AM" width="500" `src="https://user-images.githubusercontent.com/5917927/196023955-28e86ac8-fb1b-44ee-aa7a-006b7c4b9ec3.p
Deted

``` ng">`de



Dkjdlete


Gahona47 avatar Oct 02 '23 18:10 Gahona47