-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Java] Migrate the String.Format to String.Format(Locale.US) to handle different langauges for Edge, Chrome and Firefox #13934
base: trunk
Are you sure you want to change the base?
Conversation
PR Description updated to latest commit (1c526d0)
|
PR Review 🔍
|
PR Code Suggestions ✨
|
c8523ff
to
f748920
Compare
900e2be
to
db0efb4
Compare
e4ea508
to
345d639
Compare
a25e4ca
to
0effea4
Compare
I think the changes in the PR are not necessary. I looked into this further to realize the findings below:
This creates a Formatter instance:
So setting the default using " |
Before we close this PR, can you try on your end to double-check if it works as expected using " |
@pujagani But setting the setting the Default to Locale.US should work You can call it In the same create Args methods once I will change the fixes to that and give it a try? |
e8a3de9
to
a442f77
Compare
Done can you please check and let me know ? (it worked local) |
- Migrate the String.Format to Formatter.Format in : - ChromeDriverSerivce.java - EdgeDriverService.java - RemoteWebDriver.java *Issue Explaination: - Having System Date & Language in Arabic caused with driver setup. Using String.Format for ports and some other lines caused them to be localized in the system language and in arabic case it caused the numbers and some other character to be localized in arabic, e.g. the port. And that caused an issues when appending the port to the URL in order to setup the browser *Fix explaination: - Now it's utilizaing the Formatter.Format and forcing the localization to be in English.US in the Formatter Constructor
…he classes changed: - ChromeDriverSerivce.java - EdgeDriverService.java - RemoteWebDriver.java *Changes Done: - Add try with resoruces to handle memory leaks where it's applicables - Changing String.ValueOf to ToString()
- ChromeDriverService.java - EdgeDriverService.java - RemoteWebDriver.java - DriverService.java * Add Tests for both Edge and Chrome: - ChromeArabicDateTest.java at test/chrome - EdgeArabicDateTest.java at test/edge
…rService.java - Added Test Class for FirefoxArabicDateTest.java -Refactored the code of EdgeArabicDateTest.java And ChromeArabicDateTest.java to follow the same approach
- ChromeDriverService.java - EdgeDriverService.java - GeckoDriverService.java - RemoteWebDriver.java - DriverService.java
- Test added to LARGE_TESTS in BUILD.bazel - Refacotor the Test Logic
- EdgeArabicDateTest.java - ChomeArabicDateTest.java - FirefoxArabicDateTest.java
- DriverService.java - RemoteWebDriver.java Change the logic to Locale.setDefault in : - ChomeDriverSerivce.java - EdgeDriverService.java - GeckDriverService.java
8dbcc44
to
2c8755d
Compare
@pujagani I revisited the formatting issue Should be good now |
User description
Description
[🐛 Bug]: Getting SessionNotCreatedException when the Date of the Windows is in Arabic language format #13930
*Changes Done:
Motivation and Context
*Issue explaination:
*Fix explaination:
Types of changes
Checklist
PR Type
Bug fix
Description
ChromeDriverService
,EdgeDriverService
, andRemoteWebDriver
to useFormatter.format
withLocale.US
to ensure consistent formatting across different system locales.Locale.US
ensures that numbers and text are formatted in a standard way, avoiding issues related to localization.Changes walkthrough 📝
ChromeDriverService.java
Use Formatter with Locale.US in ChromeDriverService
java/src/org/openqa/selenium/chrome/ChromeDriverService.java
String.format
withFormatter.format
usingLocale.US
forconsistent number formatting.
localization issues.
EdgeDriverService.java
Standardize EdgeDriverService Formatting with Locale.US
java/src/org/openqa/selenium/edge/EdgeDriverService.java
String.format
toFormatter.format
withLocale.US
toavoid localization in log and port settings.
formats.
RemoteWebDriver.java
Implement Formatter in RemoteWebDriver for Uniform Output
java/src/org/openqa/selenium/remote/RemoteWebDriver.java
Formatter
withLocale.US
forconsistent command and log messages.