Closed raidneural closed 2 years ago
Hi, thanks for all the work you do on this project - its awesome
Thank you for the kind words!
- The case with the tabs commented in the code above - it's like when the page it's initially loaded, playwright behaves different. After clicking a second tab, the selectors produced where the expected, i.e. using the 'Text' engine
The snippet I see has a pretty nice text=Setup
selector. Are you talking about a different one?
**// NEXT: MORE WEIRD SELECTORS**
// Click text=Setup
- The different behaviors when clicking the different 'Clone' links under the 'Setup' page. I expected different selectors, since there are several links with that text, but not the shown above
Just a guess: text "Clone" appears on the page multiple times, so codegen uses a different selector to ensure we target the correct element. You can try evaluating playwright.$$('text=Clone')
in DevTools console while recording to check how many elements match the selector you think is best.
- Finally, sometimes I click a simple link with a clear text, like 'Setup', and instead of getting a nice Text selector, I got a page.goto()
This sounds like a bug! Unfortunately, I do not have a Salesforce account, so reproducing this is very hard. If you could find a publicly available repro case, we would be able to debug. Any chance this happens on some other pages as well? If you have a repro that you are comfortable sharing privately, send me something to dgozman [at] microsoft [dot] com.
@dgozman thanks for your reply
Let me further explain my thoughs on the above:
1) You are correct, you are pointing out the case where the tab was successfully read as text. Check the other one, copy-pasted here for your convenience:
// AT THIS POINT, I CLICKED ONE OF THE TABS. INSTEAD GRABBING THE TEXT, PLAYWRIGHT USED A GOTO // assert.equal(page.url(), 'https://businez.my.salesforce.com/home/home.jsp?source=lex'); // Go to https://businez.my.salesforce.com/003/o await page.goto('https://businez.my.salesforce.com/003/o');
// CLICKING IN A DIFFERENT TAB PRODUCES THE EXPECTED SELECTOR... // Click text=Accounts await page.click('text=Accounts');
The two lines refer to a tab, but the first case used a page.goto with the destination url instead of clicking the tab using the text as reference, just like with the Accounts tab
2) Again, you are correct - Clone appears several times in the page, so I did expect different selectors for each instance. The problem are the generated selectors - include IDs that are random for each user, rendering the selectors not usable for other users. Please, let me know if I'm wrong here
3) Agreed :)
I'll reach you via email in order to share some credentials with you, plus further details on the different findings
Thank you very much for your time!
@dgozman I just sent out some emails to you pointing out how to proceed to test the above by yourself
Thanks
I was able to reproduce the "goto instead of click" bug. I think this is because previous click did not finish yet, and so we are not recording the next click when it's done too fast, and instead get the goto
. Let me see what we can do here.
@dgozman I sent out some information about the other issue with the "Clone" links. Feel free to check your inbox and come back to me if you need further details - hope you will be able to reproduce it with the new info
Thanks for everything! You rock!
@dgozman I'm kindly following-up on this - did you have a chance to confirm the "Clone" link issue?
Seems like this issue is popping around different places on the website
Thanks++
We are prioritizing the bugs based on the upvotes, recency and our ability to act. It looks like this issue only has a handful of upvotes, has not been touched recently and/or we lack sufficient feedback to act on it. We are closing issues like this one to keep our bug database maintainable. Please feel free to open a new issue and link this one to it if you think this is a mistake.
Context:
System: OS: macOS 11.2.3 Memory: 1.36 GB / 16.00 GB Binaries: Node: 15.13.0 - /usr/local/bin/node npm: 7.7.6 - /usr/local/bin/npm Languages: Bash: 3.2.57 - /bin/bash
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
Describe the bug
Hi, thanks for all the work you do on this project - its awesome
I'm finding different problems when generating selectors in the app above in different cases:
Adding the pw:api logs:
pw:api waiting for selector "text=Switch to Salesforce Classic" +2s pw:api selector resolved to visible <a title="" dir="ltr" data-interactive-lib-uid="4" …>Switch to Salesforce Classic +26ms pw:api attempting click action +7ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +42ms pw:api scrolling into view if needed +1ms pw:api done scrolling +2ms pw:api checking that element receives pointer events at (991.98,75.48) +3ms pw:api element does receive pointer events +9ms pw:api performing click action +1ms pw:api click action done +18ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigated to "about:blank" +470ms pw:api "domcontentloaded" event fired +2ms pw:api navigated to "https://businez.my.salesforce.com/home/home.jsp?source=lex" +197ms pw:api navigated to "https://businez.my.salesforce.com/home/home.jsp?source=lex" +1ms pw:api navigations have finished +2ms pw:api navigated to "https://businez.my.salesforce.com/img/s.gif" +1s pw:api "domcontentloaded" event fired +483ms pw:api navigated to "about:blank" +135ms pw:api "domcontentloaded" event fired +2ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +12ms pw:api "domcontentloaded" event fired +14ms pw:api navigated to "about:blank" +117ms pw:api "domcontentloaded" event fired +2ms pw:api "load" event fired +8ms pw:api navigated to "chrome-error://chromewebdata/" +511ms pw:api "domcontentloaded" event fired +30ms pw:api "load" event fired +1ms pw:api navigated to "about:blank" +158ms pw:api "load" event fired +2ms pw:api "domcontentloaded" event fired +0ms pw:api navigated to "https://businez.my.salesforce.com/home/home.jsp?source=lex" +26ms pw:api "networkidle" event fired +1s pw:api navigated to "https://businez.my.salesforce.com/003/o" +21s pw:api "domcontentloaded" event fired +289ms pw:api navigated to "about:blank" +24ms pw:api "domcontentloaded" event fired +3ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +16ms pw:api "domcontentloaded" event fired +7ms pw:api "load" event fired +123ms pw:api "networkidle" event fired +614ms pw:api waiting for selector "text=Accounts" +9s pw:api selector resolved to visible Accounts +15ms pw:api attempting click action +3ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +36ms pw:api scrolling into view if needed +0ms pw:api done scrolling +0ms pw:api checking that element receives pointer events at (186.26,96.48) +2ms pw:api element does receive pointer events +3ms pw:api performing click action +0ms pw:api click action done +19ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigated to "https://businez.my.salesforce.com/001/o" +237ms pw:api navigated to "https://businez.my.salesforce.com/001/o" +0ms pw:api navigations have finished +2ms pw:api "domcontentloaded" event fired +206ms pw:api navigated to "about:blank" +10ms pw:api "domcontentloaded" event fired +2ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +10ms pw:api "domcontentloaded" event fired +4ms pw:api "load" event fired +12ms pw:api "networkidle" event fired +505ms pw:api waiting for selector "text=Setup" +2s pw:api selector resolved to visible <a title="Setup" id="setupLink" href="/setup/forcec…>Setup +11ms pw:api attempting click action +2ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +17ms pw:api scrolling into view if needed +0ms pw:api done scrolling +1ms pw:api checking that element receives pointer events at (977.81,44) +0ms pw:api element does receive pointer events +3ms pw:api performing click action +0ms pw:api click action done +8ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigated to "https://businez.my.salesforce.com/setup/forcecomHomepage.apexp?setupid=ForceCom&retURL=%2F001%2Fo" +352ms pw:api navigated to "https://businez.my.salesforce.com/setup/forcecomHomepage.apexp?setupid=ForceCom&retURL=%2F001%2Fo" +0ms pw:api navigations have finished +2ms pw:api navigated to "about:blank" +2s pw:api navigated to "https://businez.my.salesforce.com/setup/forcecomHomepage.apexp?setupid=ForceCom&retURL=%2F001%2Fo" +2ms pw:api navigated to "about:blank" +5ms pw:api navigated to "https://businez.my.salesforce.com/setup/forcecomHomepage.apexp?setupid=ForceCom&retURL=%2F001%2Fo" +2ms pw:api navigated to "about:blank" +5ms pw:api navigated to "https://businez.my.salesforce.com/setup/forcecomHomepage.apexp?setupid=ForceCom&retURL=%2F001%2Fo" +2ms pw:api "domcontentloaded" event fired +20ms pw:api navigated to "about:blank" +10ms pw:api "domcontentloaded" event fired +1ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +15ms pw:api "domcontentloaded" event fired +24ms pw:api navigated to "https://www.developerforce.com/ootbe/" +101ms pw:api "domcontentloaded" event fired +21ms pw:api navigated to "https://appexchange.salesforce.com/setupModule" +225ms pw:api navigated to "https://trailblazer.salesforce.com/communitySetupModule" +330ms pw:api "domcontentloaded" event fired +427ms pw:api "load" event fired +677ms pw:api "networkidle" event fired +496ms pw:api waiting for selector "img[alt="Expand - Manage Users - Level 1"]" +2s pw:api selector resolved to visible <img width="11" height="11" class="setupImage" alt="E…/> +10ms pw:api attempting click action +1ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +4ms pw:api scrolling into view if needed +0ms pw:api done scrolling +1ms pw:api checking that element receives pointer events at (25.48,464.48) +0ms pw:api element does receive pointer events +3ms pw:api performing click action +0ms pw:api click action done +6ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigations have finished +2ms pw:api waiting for selector "text=Permission Sets" +3s pw:api selector resolved to visible <a id="PermSets_font" href="/0PS?setupid=PermSets&r…>Permission Sets +16ms pw:api attempting click action +1ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +5ms pw:api scrolling into view if needed +0ms pw:api done scrolling +1ms pw:api checking that element receives pointer events at (98.31,546) +1ms pw:api element does receive pointer events +3ms pw:api performing click action +0ms pw:api click action done +38ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigated to "https://businez.my.salesforce.com/0PS?setupid=PermSets&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DUsers" +409ms pw:api navigated to "https://businez.my.salesforce.com/0PS?setupid=PermSets&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DUsers" +0ms pw:api navigations have finished +2ms pw:api navigated to "about:blank" +842ms pw:api "domcontentloaded" event fired +13ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +52ms pw:api "domcontentloaded" event fired +8ms pw:api "load" event fired +91ms pw:api "networkidle" event fired +684ms pw:api waiting for selector "text=Clone" +5s pw:api selector resolved to visible Clone +25ms pw:api attempting click action +4ms pw:api waiting for element to be visible, enabled and stable +0ms pw:api element is visible, enabled and stable +34ms pw:api scrolling into view if needed +0ms pw:api done scrolling +0ms pw:api checking that element receives pointer events at (282.67,285) +1ms pw:api element does receive pointer events +3ms pw:api performing click action +0ms pw:api click action done +29ms pw:api waiting for scheduled navigations to finish +0ms pw:api navigated to "https://businez.my.salesforce.com/udd/PermissionSet/newPermissionSet.apexp?retURL=%2F0PS%3Ffcf%3D00B5e000001j4oK%26rolodexIndex%3D-1%26page%3D1&id=0PS5e000000wrye&setupid=PermSets" +486ms pw:api navigated to "https://businez.my.salesforce.com/udd/PermissionSet/newPermissionSet.apexp?retURL=%2F0PS%3Ffcf%3D00B5e000001j4oK%26rolodexIndex%3D-1%26page%3D1&id=0PS5e000000wrye&setupid=PermSets" +0ms pw:api navigations have finished +2ms pw:api navigated to "about:blank" +270ms pw:api "domcontentloaded" event fired +9ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +6ms pw:api "domcontentloaded" event fired +5ms pw:api "load" event fired +106ms pw:api "networkidle" event fired +503ms pw:api navigated to "https://businez.my.salesforce.com/0PS?setupid=PermSets&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DUsers" +95ms pw:api navigated to "about:blank" +219ms pw:api "domcontentloaded" event fired +11ms pw:api navigated to "https://login.salesforce.com/login/sessionserver212.html" +8ms pw:api "domcontentloaded" event fired +2ms pw:api "load" event fired +46ms pw:api "networkidle" event fired +531ms pw:api waiting for selector "text=On this page you can create, view, and manage permission sets. In addition, you " +19s pw:api selector resolved to visible
Again, thank you for the awesome project!