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

[Bug]: Traceviewer not reporting all actions #1617

Closed
ShanmukhaGajula opened this issue Jul 2, 2024 · 8 comments
Closed

[Bug]: Traceviewer not reporting all actions #1617

ShanmukhaGajula opened this issue Jul 2, 2024 · 8 comments
Assignees
Labels

Comments

@ShanmukhaGajula
Copy link

ShanmukhaGajula commented Jul 2, 2024

Version

1.45.0

Steps to reproduce

public String Input_locator_basedonLabel(String label) {
		if(label.equalsIgnoreCase("Client Industry")) {
			return "//*[@class='ajax__tab_panel' and @style='visibility: visible;']//*[text()='"+label+": ']/parent::tr//*[self::textarea or self::input or self::select]";
		}
		else {
			return "//*[@class='ajax__tab_panel' and @style='visibility: visible;']//*[text()='"+label+":']/parent::tr//*[self::textarea or self::input or self::select]";
		}
		
	}
 public void fill_opp_details() {
		  page.fill(Input_locator_basedonLabel("Opportunity Name"), "Shanmukha Playwright Java Opportunity");
		  page.fill(Input_locator_basedonLabel("Opportunity Owner"), "Shanmukha Gajula");
		  page.fill(Input_locator_basedonLabel("Account Name"), "Shanmukha Playwright Java Account");
		  page.locator("text='SF Other Details'").click();
		  page.fill(Input_locator_basedonLabel("Comments"), "Shanmukha Playwright Java");
		  page.fill(Input_locator_basedonLabel("Main Competitor"), "Shanmukha ");
		  page.locator(Input_locator_basedonLabel("Client Industry")).selectOption("Manufacturing");
	 }

Expected behavior

To have all the actions in the Traceviewer

Actual behavior

though script is performing all the actions only recent log of fill, select are being shown in trace viewer

image

Additional context

No response

Environment

Java version : 21
Browser : chromium
Operating System: Windows 11
Platform: win32

@mxschmitt
Copy link
Member

would it be possible to provide a reproduction which we can run locally? Ideally a single file, e.g. starting from here.

@ShanmukhaGajula
Copy link
Author

ShanmukhaGajula commented Jul 5, 2024

would it be possible to provide a reproduction which we can run locally? Ideally a single file, e.g. starting from here.

import java.nio.file.Paths;

import com.microsoft.playwright.Browser;
import com.microsoft.playwright.BrowserContext;
import com.microsoft.playwright.BrowserType;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
import com.microsoft.playwright.Tracing;

public class Test {
  public static void main(String[] args) {
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions()
        .setHeadless(false));
      BrowserContext context = browser.newContext();
   // Start tracing before creating / navigating a page.
      context.tracing().start(new Tracing.StartOptions()
        .setScreenshots(true)
        .setSnapshots(true)
        .setSources(true));
      Page page = context.newPage();
      page.navigate("https://letcode.in/edit");
      page.getByPlaceholder("Enter first & last name").click();
      page.getByPlaceholder("Enter first & last name").fill("test");
      page.getByPlaceholder("Enter first & last name").press("Tab");
      page.locator("#join").fill("rtste");
      page.locator("#join").press("Tab");
      page.locator("#getMe").fill("sdfhbdsf");
      page.locator("#getMe").press("Tab");
      page.locator("#clearMe").fill("dfhbsdfgbsdf");
      page.locator("#dontwrite").click();
   // Stop tracing and export it into a zip archive.
      context.tracing().stop(new Tracing.StopOptions()
        .setPath(Paths.get("trace.zip")));
    }
  }
}

@ShanmukhaGajula
Copy link
Author

But it reported these actions only
image

@ShanmukhaGajula
Copy link
Author

would it be possible to provide a reproduction which we can run locally? Ideally a single file, e.g. starting from here.

Hi @mxschmitt, I have provided a single file, and I'm able to reproduce the issue. Please validate from your side using version 1.45.0

@yury-s
Copy link
Member

yury-s commented Jul 10, 2024

Thanks, I can reproduce it.

@yury-s yury-s added the v1.46 label Jul 10, 2024
@yury-s
Copy link
Member

yury-s commented Jul 10, 2024

I can only reproduce it when opening newer trace (1.45.0) with older trace viewer (<=1.44.0). @ShanmukhaGajula do you see the issue with the trace viewer from v1.45.0?

@yury-s yury-s self-assigned this Jul 11, 2024
@ShanmukhaGajula
Copy link
Author

ShanmukhaGajula commented Jul 12, 2024

I can only reproduce it when opening newer trace (1.45.0) with older trace viewer (<=1.44.0). @ShanmukhaGajula do you see the issue with the trace viewer from v1.45.0?

This is working fine in 1.44.0 and I think this issue is only with 1.45.0

@uchagani
Copy link
Contributor

I'm seeing this issue with a trace recorded with 1.45 on the current traceviewer at https://trace.playwright.dev

yury-s added a commit to microsoft/playwright that referenced this issue Jul 22, 2024
yury-s added a commit to yury-s/playwright that referenced this issue Jul 22, 2024
yury-s added a commit to microsoft/playwright that referenced this issue Jul 22, 2024
… merge actions (#31780)

This PR cherry-picks two trace viewer fixes: 
cherry-pick(#31768): fix(trace viewer): library-only trace should not
merge actions
cherry-pick(#31564): fix(trace): do not corrupt test runner actions when
no library trace is present

Reference: microsoft/playwright-java#1617
yury-s added a commit to microsoft/playwright that referenced this issue Jul 22, 2024
szinn pushed a commit to szinn/wordacle that referenced this issue Jul 23, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@playwright/test](https://playwright.dev)
([source](https://togithub.com/microsoft/playwright)) | devDependencies
| patch | [`1.45.2` ->
`1.45.3`](https://renovatebot.com/diffs/npm/@playwright%2ftest/1.45.2/1.45.3)
|

---

### Release Notes

<details>
<summary>microsoft/playwright (@&#8203;playwright/test)</summary>

###
[`v1.45.3`](https://togithub.com/microsoft/playwright/releases/tag/v1.45.3)

[Compare
Source](https://togithub.com/microsoft/playwright/compare/v1.45.2...v1.45.3)

##### Highlights


[microsoft/playwright#31764
- \[Bug]: some actions do not appear in the trace
file[microsoft/playwright-java#1617
- \[Bug]: Traceviewer not reporting all actions

#### Browser Versions

-   Chromium 127.0.6533.5
-   Mozilla Firefox 127.0
-   WebKit 17.4

This version was also tested against the following stable channels:

-   Google Chrome 126
-   Microsoft Edge 126

</details>

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19-->

Co-authored-by: repo-jeeves[bot] <106431701+repo-jeeves[bot]@users.noreply.github.com>
@yury-s yury-s closed this as completed Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants