Wednesday, June 1, 2016

Trouble shooting error messages on selenium C# -02

I faced below exception :( 

Test method AppiumDTZ.Test_ProfilePage.Validate_Updating_Mobile_Phone_umber threw exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: unknown error: Element is not clickable at point (180, 546). Other element would receive the click: <div class="bar bar-footer ugl-footer app-common-footer" dtz-hide-on-keyboard-show="">...</div>
  (Session info: webview=33.0.0.0)
  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.3 x86_64)
Result StackTrace:

Root course for this was, the element which im try to click was under a transparent element.
The transparent layer was static and cant move.

So when ever i try to click on the button it will search on the transparent layer.
There for i have to scroll the bottom layer to the top or the maximum  to get my button out of the transparent layer.

I tried with different mechanisms to scroll the layer but nothing works for me except this.


                IJavaScriptExecutor js = (IJavaScriptExecutor)InitialiseAppium.driver;
                js.ExecuteScript("arguments[0].scrollIntoView()", <elemant name>);