Closed
Description
openedon Mar 10, 2021
Here is a snippet which used to work with 1.8.0a
if not self.frameH.is_checked(f"text='{checkbox_label}'"):
self.frameH.check(f"text='{checkbox_label}'")
self.save_settings(framehandle=self.frameH)
else:
print("Category is already checked... ignoring request")
DomTree is as follows
<span id="thePage:frm:j_id237:URLSettings:j_id253:2:j_id255" class="fs-toggle-checkbox">
<input id="thePage:frm:j_id237:URLSettings:j_id253:2:category" type="checkbox" name="thePage:frm:j_id237:URLSettings:j_id253:2:category">
<label for="thePage:frm:j_id237:URLSettings:j_id253:2:category" class="slds-checkbox--button__label">
<span class="fs-icon-check" id="adultCategory">
<img src="/resource/1614935913000/afscb__SLDS0203/assets/icons/utility/check_60.png" class="slds-icon slds-icon--selected slds-icon--x-small slds-icon-text-default slds-m-right--x-small">
</span> adult
</label>
</span>
after upgrading to 1.9 Playwright seems to find element but waits for it to be visible, as can be seen from debug logs in image below
I then tried to make more precise locator which would pinpoint to the input element as follows --
self.frameH.check(f"//label[contains(.,'{checkbox_label}')]/preceding-sibling::input")
But that does not help. What helps infact is doing this (notice its same pinpointed loctor)
self.frameH.eval_on_selector(f"//label[contains(.,'{checkbox_label}')]/preceding-sibling::input", "checkbox =>checkbox.checked=true")
I believe there is something broken with 1.9.0 which is the version I am using at the moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels