51
rated 0 times
[
58]
[
7]
/ answers: 1 / hits: 19601
/ 6 Years ago, wed, july 25, 2018, 12:00:00
I have a button that has an initial state of disabled
-
<button type = submit class=ant-btn ant-btn-primary ant-btn-lg disabled>
The disabled
attribute is not present once the conditions are met - so the HTML becomes
<button type = submit class=ant-btn ant-btn-primary ant-btn-lg>
I want to check that the button has attribute disabled
, however since the attribute has no value in it, I am not able to find to a way to do so.
For example, if the disabled
attribute had something like this
<button type = submit class=ant-btn ant-btn-primary ant-btn-lg disabled = disabled>
then I can do something like this
let button = await page.$('button');
let valueHandle = await input.getProperty('disabled');
assert.equal(await valueHandle.jsonValue(), 'disabled');
but since there is no value for the attribute, how to proceed in this case?
More From » css-selectors