-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] page.waitForSelector fails when called during a redirect #4002
Comments
This is very interesting. My immediate guess would be that InjectedScript is corrupted on some redirect hosts, because they override some builtins like Could it be that in the actual scenario you use a custom selector engine, or different selector, or maybe |
Thanks for the input @dgozman. This is a pretty simple case apart from the redirects. I do actually have a repro to share, it's just not a minimal one. But at least you can see what code I'm using. This repro requires the uuid package to be installed locally. const { chromium } = require('playwright-chromium');
const { v1: uuid } = require('uuid');
const AdobeSusi = {
emailField: '#Signup-EmailField',
firstNameField: '#Signup-FirstNameField',
lastNameField: '#Signup-LastNameField',
passwordField: '#Signup-PasswordField',
dayOfBirthField: '.Signup-DateOfBirthChooser__day input',
yearOfBirthField: '.Signup-DateOfBirthChooser__year input',
createAccountButton: '.spectrum-Button-label >> text="Create account"',
passwordStrengthIndicator: '.PasswordStrength',
};
function generateUserData() {
const uniqueID = uuid().replace('-', '');
return {
firstName: `first${uniqueID}`,
lastName: `last${uniqueID}`,
dob: '1990-01-01',
email: `automation-${uniqueID}@gmail.com`,
countryCode: 'US',
username: `automation-${uniqueID}@gmail.com`,
password: 'P@ssword',
companyValue: 'Loud Talkers',
titleValue: 'Automation Tester',
cityValue: 'Mobile',
location: 'Mobile, AL, USA',
};
}
async function signUpThroughSusiUi(page) {
const userData = generateUserData();
await page.type(AdobeSusi.emailField, userData.email);
await page.type(AdobeSusi.firstNameField, 'Automated');
await page.type(AdobeSusi.lastNameField, 'Tester');
await page.type(AdobeSusi.passwordField, userData.password);
await page.type(AdobeSusi.dayOfBirthField, '1');
await page.type(AdobeSusi.yearOfBirthField, '1990');
await page.waitForSelector(AdobeSusi.passwordStrengthIndicator, { state: 'hidden' });
await page.click(AdobeSusi.createAccountButton);
}
(async () => {
const browser = await chromium.launch({
headless: false,
});
const page = await browser.newPage();
await page.goto('https://www.behance.net', { waitUntil: 'domcontentloaded' });
await page.waitForTimeout(2000);
await page.click('.js-adobeid-signup');
await signUpThroughSusiUi(page);
// await page.waitForTimeout(5000);
// ^ If I add this line back in it works, most likely because
// all the redirects have finished before waitForSelector is called
await page.waitForSelector('.rf-logo');
await browser.close();
})(); |
@celeryclub Thanks for the script, I am able to repro! Sometimes it fails with timeout trying to navigate, but other times I can see the |
Thanks so much @dgozman! |
When running against the ToT Playwright, I get the This seems to be caused by remote object ids clashing between different processes, e.g. |
I think this should be fixed with the latest Chromium roll. Let me close this optimistically 😄 Please comment/reopen if the issue persists. |
Hello, we're having the same issue with Note that they work correctly when ran with a visible electron window, but fail when ran through (I'm pinging you @dgozman because I'm not sure commenting on a closed issue will be trigger a notification) |
@pixelastic This should be fixed with the next version of Electron itself, once the fix from Chromium is rolled in. So, if you plan to upgrade your Electron to the next version, things should work. I believe that Electron 12 that is based on Chromium M89 will have the fix. |
Context:
System:
OS: macOS 10.15.7
Memory: 226.13 MB / 32.00 GB
Binaries:
Node: 12.18.3 - /var/folders/sn/fccqtk995ll0h2b7wtp1z_z80000gr/T/fnm-shell-5071240/bin/node
npm: 6.14.8 - /var/folders/sn/fccqtk995ll0h2b7wtp1z_z80000gr/T/fnm-shell-5071240/bin/npm
Languages:
Bash: 3.2.57 - /bin/bash
Describe the bug
Hi team. I'm seeing an issue with
waitForSelector
throwing an error in some cases. When I call it during a series of server redirects, it's throwing. However, if I usewaitForTimeout
to let the redirects finish, and then callwaitForSelector
, everything is fine.When I run this, I see this error:
Or sometimes this error:
I've tried creating a minimal repro of this issue, but I'm struggling to get it to happen outside of my staging environment. Any suggestions for a potential way to repro this would be much appreciated.
The text was updated successfully, but these errors were encountered: