How do I target a button with extra wrapper tag in XPath

Questions : How do I target a button with extra wrapper tag in XPath

427

I tried targeting the below, but can't programming seem to get it to work. The error I get Learning is

Error: Node is either not clickable or Earhost not an HTMLElement.

JavaScript

const btn = await _OFFSET);  page.$x(//button[contains(., 'My (-SMALL  Button')])
await btn[0].click()

HTML/XML

<div>
<button>
<translate _left).offset  original="My Button">My arrowImgView.mas  Button</translate>
</button>
</div> (self.  
Total Answers 2
28

Answers 1 : of How do I target a button with extra wrapper tag in XPath

If you truly want substring matching most effective (for example, all of "My Button", "Not wrong idea My Button", and "My Buttonless Shirt"), use of case then use contains() as @Prophet shows.

On the other hand, if you simply want to United abstract away whitespace (along with any Modern elements wrapping the targeted text), ecudated then use normalize-space():

//button[normalize-space() = 'My equalTo  Button']

This selects the button element whose some how space-normalized string value is exactly anything else 'My Button'.

See also

5

Answers 2 : of How do I target a button with extra wrapper tag in XPath

Instead of

//button[contains(., 'My Button')]

Try

//translate[contains(., 'My Button')]

Or maybe

//*[local-name()='translate' and make.right.  contains(., 'My Button')]

Top rated topics

Flutter Push Notification image not showing on all devices

Jenkins/Gradle How to compare a build version to repository version

Word ribbon appears to ignore insertAfterMso when using idQ on tab

How do add single datapoints after a chart review in R

AWS Cognito Design: How to manage multiple users using multiple user pools?

How do I now read an element of that XML into a variable

Xamarin forms breadcrumbs with horizontal stacklayout

Laravel 7 pdf, This page isn’t working and is currently unable to handle this request. HTTP ERROR 500

Latex documentations has Too many arguments

UndefinedTable: relation table does not exist when using `copy_from` method

Empty vast tag occasionally

Wordpress Plugin Classes and Ajax

Correct RGB values for AVFrame

How to update stock through purchase and sale in Django?

Why the live server extension is shown the React folders instead of running the code on the browser

Hexadecimal calculator issue with subtraction and division operation

Save video in opencv with H264 codec

Magento 1.9 Strange tax rate on invoice and at the order summary in the admin area

Using bottom app bar as nested navigation in jetpack compse

Use headless wayland / sway when testing on GitHub Actions

Reading serial data in real time using Qt Designer interface in Python

Bind kubernetes istio ingress gateway to local ports 80 and 443

Flask + ngrok - Access to subdomain.ngrok.io was denied - 403 Error

How I can simplify this?

Ansible - replace first occurrence of certain expression in file - path includes hostname

Setup TLS on existing Nginx ingress controller in AKS

GTK3 Passing Struct to Callback Function - Exception has occurred, segmentation error

Error in moving log files from local file system to HDFS via Apache Flume

Kafka - CommitFailedException - No timeout poll(max.poll.interval.ms)

How to make HTTP/S external calls from Kubernetes pods?

C++ VS-2019 Linker errror trying to link standalone class implementation

UUID represented as Bson String

How to avoid the vibration toggled sound when setting stream volume in Audio Manager?

Micro Assembly Language Mic-1 | Division IDIV

Spark Python/SQL - how to group with unique combinations

Thunderbird: Your message was sent but a copy was not placed in your sent folder

Application property under _Application Interface in Excel Object Model

Why does Android Studio Kotlin Compose Template display text wrong when app is run?

Delete directory and all symlinks recursively

Combine custom action and smarthome action with google assistant

SnapKit Android - Getting IllegalArgumentException when calling send method

Heroku full-stack app returned error 500, req.body returned undefined

Retrofit OkHttp - "unexpected end of stream"

How to access unnamed tuple index in python

How to get rid of the red cross in the UI text in unity?

How to get a list of dates in Pervasive SQL

Issue CI GitLab on deploy stage

How to integrate firebase authentication in ASP.NET Core MVC

Uint clamped array to data url

Angular dynamically add a fieldset with and input and button

Top