2gis / Winium.Mobile

Winium.Mobile is Selenium Remote WebDriver implementation for automated testing of Windows StoreApps and Silverlight apps, tested on emulators (currently only Windows Phone/Mobile apps are supported).
Mozilla Public License 2.0
51 stars 29 forks source link

Incorrect driver response #100

Closed tkurnosova closed 9 years ago

tkurnosova commented 9 years ago

Драйвер возвращает ответ на любой запрос кроме создания сессии с null значением поля SessionId. Из-за чего биндинги не могут его распарсить. Ниже приведены списки команд и ответы от ChromeDriver

Т.о. нужно добавить значение SessionId в ответ на любой запрос к драйверу

NickAb commented 9 years ago

Essence of the problem

Driver returns session id only for commands executed by Driver (e.g. NewSession, GetOrientation), not inner server (e.g. FindElement, IsElementEnabled) due to the fact that InnerServer has no concept of a session in it and Driver simply proxies responses from InnerServer for such commands.

This problem appeared when trying to use custom WebDriver service in .NET. Selenium bindings for .NET does not seem to expect sessionId in all responses. Need to check bindings, it seems that sessionId is saved on NewSession and can be omitted in other commands if sessionId key is not present. But it would be better to support correct responses.

  1. We can pass sessionId to InnerServer and make it return it in responses
  2. We can parse response from InnerServer on the Driver and add sessionId here, without modifying InnerServer
  3. Rework InnerServer to use simply JSON PRC so that InnerServer does not have any logic on how to handle responses for Selenium clients, so that this logic is contained in Driver only.
NickAb commented 9 years ago

Fixed in #103