Skip to content
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

[Question]page.frame not referencing url in Chrome Dev Tools for Power BI report #3918

Closed
wadezone opened this issue Sep 17, 2020 · 4 comments

Comments

@wadezone
Copy link

Thanks for writing in, @wadezone. I'm not exactly sure if I understand the issue but I was able to use the website that you've shared to play with the app a bit and write a starter script using with Playwright.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto('https://community.powerbi.com/t5/Data-Stories-Gallery/Customer-Analysis-Dashboard/td-p/630893#');
  const frame = page.frame({ url: 'https://app.powerbi.com/view**' });
  await frame.click('text="Weimei Corp"');
  await frame.click('text="Weimei Corp"', {button: 'right'});
  await frame.click('text="Copy"');
  await frame.click('text="Copy value"');
  
  await browser.close();
})();

I was able to click on the selector with text="Weimei Corp and do some actions on the right-click context menu. Are you thinking of building something like this? If you have a specific question, please feel free to re-open the issue.

Originally posted by @arjun27 in #3915 (comment)

@wadezone wadezone changed the title Thanks for writing in, @wadezone. I'm not exactly sure if I understand the issue but I was able to use the website that you've shared to play with the app a bit and write a starter script using with Playwright. page.frame not referencing url in Chrome Dev Tools for Power BI report Sep 17, 2020
@wadezone
Copy link
Author

I apologize, I guess I don't know how to re-open and reference previous notes to new issue when commenting it doesn't solve my particular issue.

Thanks for taking a look at that. I did do a playwright cli on that sight and the difference between that report and ours is this line. We don't have a view reference for our frame. This might have been required for them to make it public.

const frame = page.frame({ url: 'https://app.powerbi.com/view**' });

My playwright is only returning the following when I click on the name which isn't working.
// 0× click
await page1.click('//iframe');

// Click text="THERESA WADE"
await page1.click('text="THERESA WADE"');

When I do this below I get the iframe name but unable to figure out how to reference the items in the rows
//locate the iframe name visual sandbox
const frame = page.frames().find(frame => frame.name() === 'visual-sandbox');
console.log(frame.name());

@wadezone wadezone changed the title page.frame not referencing url in Chrome Dev Tools for Power BI report [Question]page.frame not referencing url in Chrome Dev Tools for Power BI report Sep 17, 2020
@pavelfeldman
Copy link
Member

Looks like a bug with the selector generation in playwright-cli. We'll be looking at frames as we do shadow dom there. Having a reduced test case would help!

@dgozman
Copy link
Contributor

dgozman commented Oct 1, 2020

Let's address this in microsoft/playwright-cli#71.

@dgozman dgozman closed this as completed Oct 1, 2020
@wadezone
Copy link
Author

wadezone commented Oct 1, 2020

@pavelfeldman Didn't get a notification to see this before it was closed. What exactly are you looking for as a reduced test case? I can take the public Power BI report I referenced in my initial question and give you steps. Is this what you are looking for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants