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

appium server log is logging wrong time zone's time desiredCapabilities.setCapability("--local-timezone", false); not working #9022

Closed
vikramvi opened this issue Aug 14, 2017 · 10 comments
Labels
ThirdParty upstream problems

Comments

@vikramvi
Copy link
Contributor

vikramvi commented Aug 14, 2017

The problem

  • while running tests I've observed that appium server was wrong time in wrong time zone. I'm into CEST time zone but it's logging time from UTC ( current - 2 hrs )
  • I added capability desiredCapabilities.setCapability("--local-timezone", false); to explicitly
    ( Reference: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md )
  • but still appium server log is showing time = current time - 2:00
  • Eclipse console does show correct timestamp
  • Tried desiredCapabilities.setCapability("--local-timezone", true) but same result

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.6-beta.3
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: Mac 10.12.5
  • Node.js version (unless using Appium.app|exe): v7.9.0
  • Mobile platform/version under test:
  • Real device or emulator/simulator: Emulator
  • Appium CLI or Appium.app|exe: NA

Details

mentioned in problem statement itself

Link to Appium logs

appium log

Eclipse console log

Code To Reproduce Issue [ Good To Have ]

NA

@vikramvi vikramvi changed the title appium server log is logging wrong time zone's time desiredCapabilities.setCapability("--local-timezone", true); not working appium server log is logging wrong time zone's time desiredCapabilities.setCapability("--local-timezone", false); not working Aug 14, 2017
@imurchie
Copy link
Contributor

--local-timezone is a server argument. It is used when invoking the Appium server:

appium --local-timezone

@vikramvi
Copy link
Contributor Author

@imurchie

I tried starting appium server as below

AppiumDriverLocalService driverLocalService1 = AppiumDriverLocalService
                                         .buildService(new AppiumServiceBuilder()
                                         	.withAppiumJS(new File("/usr/local/lib/node_modules/appium/build/lib/main.js"))
                    				.usingDriverExecutable(new File("/usr/local/bin/node"))
                                                 .usingPort(portNumber)
                                                 .withLogFile(logFile)
                                                 .withArgument(AndroidServerFlag.BOOTSTRAP_PORT_NUMBER, Integer.toString(bootstrapPortNumber) )
                                                 .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                                                 .withArgument(GeneralServerFlag.LOG_LEVEL, "debug")
                                                 .withArgument(GeneralServerFlag.CONFIGURATION_FILE, nodeConfigFilePath)
                                                 .withArgument(GeneralServerFlag.LOCAL_TIMEZONE, "true")  //THROWING EXCEPTION
                                         .withCapabilities(new DesiredCapabilities(ImmutableMap.of(MobileCapabilityType.UDID, UDID))));
                                 
                    	      driverLocalService1.start();

this is throwing exception

/usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:380
   						          parts.forEach(function (part) {
   						                ^
   						  TypeError: parts.forEach is not a function
   						      at _getLines (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:380:15)
   						      at HelpFormatter._formatUsage (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:418:17)
   						      at /usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:67:17
   						      at Array.map (native)
   						      at Section.formatHelp (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:61:26)
   						      at HelpFormatter.formatHelp (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/help/formatter.js:300:32)
   						      at ArgumentParser.formatUsage (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/argument_parser.js:1026:20)
   						      at ArgumentParser.printUsage (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/argument_parser.js:1082:27)
   						      at ArgumentParser.error (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/argument_parser.js:1156:8)
   						      at ArgumentParser.parseArgs (/usr/local/lib/node_modules/appium/node_modules/argparse/lib/argument_parser.js:239:10)
   						      at ArgumentParser.parser.parseArgs (../../lib/parser.js:752:29)
   						      at main$ (../../lib/main.js:146:4)
   						      at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
   						      at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
   						      at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
   						      at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
   						      at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
   						      at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
   						      at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
   						      at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
   						      at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
   						      at main (../../lib/main.js:152:13)
   						      at asyncify (lib/asyncbox.js:65:15)
   						      at Object.<anonymous> (../../lib/main.js:183:2)
   						      at Module._compile (module.js:571:32)
   						      at Object.Module._extensions..js (module.js:580:10)
   						      at Module.load (module.js:488:32)
   						      at tryModuleLoad (module.js:447:12)
   						      at Function.Module._load (module.js:439:3)
   						      at Module.runMain (module.js:605:10)
   						      at run (bootstrap_node.js:423:7)
   						      at startup (bootstrap_node.js:147:9)
   						      at bootstrap_node.js:538:3

@imurchie
Copy link
Contributor

What is the command that is being generated to invoke Appium?

@mykola-mokhnach
Copy link
Collaborator

.withArgument(GeneralServerFlag.LOCAL_TIMEZONE, "true")  

Probably, it expects boolean true rather than String one

@mykola-mokhnach mykola-mokhnach added the ThirdParty upstream problems label Aug 14, 2017
@vikramvi
Copy link
Contributor Author

vikramvi commented Aug 15, 2017

@mykola-mokhnach @imurchie Please clarify if this appium server side issue or appium java client ?

.withArgument(GeneralServerFlag.LOCAL_TIMEZONE, true)
throws below compilation error

The method withArgument(ServerArgument, String) in the type AppiumServiceBuilder is not applicable for the arguments (GeneralServerFlag, boolean)

cc: @TikhomirovSergey

@mykola-mokhnach
Copy link
Collaborator

try to skip the second argument at all: withArgument(GeneralServerFlag.LOCAL_TIMEZONE)

@vikramvi
Copy link
Contributor Author

@mykola-mokhnach your suggestion worked perfectly.

Now the remaining bug is; if someone wants to set explicit value for this argument say true / false , how it can be done ?

@mykola-mokhnach
Copy link
Collaborator

For this particular flag there are two possible states - it either exists or not. So, setting the falue to "false" should just emulate the argument is not present. Anyway, this is an enhancement request to java client itself.

@vikramvi
Copy link
Contributor Author

vikramvi commented Aug 15, 2017

@mykola-mokhnach I think this is a bug and not an enhancement.

As per https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md, default value is false and user needs to pass true flag for this

To get it work for now, I'm just adding the flag and it's taking its value as true by default instead of false as per documentation

have opened new issue appium/java-client#694

@lock
Copy link

lock bot commented Apr 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ThirdParty upstream problems
Projects
None yet
Development

No branches or pull requests

3 participants