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

Documentation feedback: /docs/sources/k6/v0.56.x/javascript-api/k6-browser/locator/type.md #4286

Open
tnakamura-ic opened this issue Jan 27, 2025 · 2 comments
Assignees

Comments

@tnakamura-ic
Copy link

tnakamura-ic commented Jan 27, 2025

Bug: k6-browser/locator/type does not recognize Japanese characters in the "text" argument

Description

The type() method of k6-browser/locator fails to recognize Japanese characters passed in its first argument, "text".

As a result, the browser cannot interpret the input as valid Japanese text, causing validation check errors. This prevents full automation of browser interactions. Given the high frequency of Japanese web services, this issue is expected to impact many developers in Japan. We request a quick resolution to this problem!


Cause

When using k6/browser and passing Japanese text into the type(text, [options]) method, the first argument, "text," is converted into Unicode escape sequences.

For example:

  • Actual input text: 大谷翔平とイチロー
  • Displayed in k6 terminal logs: \u5927\u8c37\u7fd4\u5e73\u3068\u30a4\u30c1\u30ed\u30fc

This behavior was confirmed by logging the input value (console.log()) in the browser console and observing the logs in the k6 terminal.


Steps to Reproduce

  1. Prepare a web page with an input form.
  2. Use k6/browser/locator and its type() method to input Japanese text into an input field (<input> tag).
  3. Ensure the input field is configured to accept only Japanese text through validation.

Expected Behavior

  1. The Japanese text is entered into the input field.
  2. The browser successfully receives the Japanese string.
  3. The validation check passes.
  4. The form's submit button becomes active.

Actual Behavior

  1. The Japanese text is entered into the input field.
  2. The browser fails to correctly interpret the Japanese string.
  3. The validation check fails.
  4. The form's submit button remains inactive (disabled).

Environment Information

  • k6 version: k6 v0.55.0 (go1.23.3, darwin/arm64)
  • k6-browser version: 132.0.6834.111
  • Device: MacBook Air M2, macOS Ventura 13.6
  • Browser: Chromium(Ver. 132.0.6834.111(Official Build) (arm64))
  • Frontend Framework: JavaScript (Vue.js Ver. 3.2.47)
@heitortsergent
Copy link
Contributor

Hi @tnakamura-ic! Thanks for opening this issue, and sorry about the bug.

CC'ing @grafana/k6-browser, should we move this issue to the k6-browser or k6 repo?

@ankur22 ankur22 transferred this issue from grafana/k6-docs Jan 27, 2025
@ankur22
Copy link
Contributor

ankur22 commented Jan 27, 2025

@heitortsergent i've moved it to the k6 repo.

@inancgumus inancgumus removed the triage label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants