public void Execute(Arguments arguments) { arguments.Search.Value = "com.tumblr:id/topnav_account_button_img_active"; arguments.By.Value = "id"; var by = arguments.By.Value.ToLower(); if (by == "xy") { TouchAction clickAction = new TouchAction(OpenCommand.GetDriver()); var coordinates = arguments.Search.Value.Split(','); clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform(); } else { ElementHelper.GetElement(by, arguments.Search.Value).Click(); } }
public void Execute(Arguments arguments) { arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.view.ViewGroup / androidx.viewpager.widget.ViewPager / android.view.ViewGroup / android.widget.LinearLayout / android.view.ViewGroup"; arguments.By.Value = "xpath"; var by = arguments.By.Value.ToLower(); if (by == "xy") { TouchAction clickAction = new TouchAction(OpenCommand.GetDriver()); var coordinates = arguments.Search.Value.Split(','); clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform(); } else { ElementHelper.GetElement(by, arguments.Search.Value).Click(); } }
public void Execute(Arguments arguments) { arguments.Search.Value = "com.tumblr:id/topnav_account_button_img_active"; arguments.By.Value = "id"; var by = arguments.By.Value.ToLower(); if (by == "xy") { TouchAction clickAction = new TouchAction(OpenCommand.GetDriver()); var coordinates = arguments.Search.Value.Split(','); clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform(); } else { ElementHelper.GetElement(by, arguments.Search.Value).Click(); arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/android.widget.ViewSwitcher/android.widget.ViewSwitcher/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.TextView[2]"; arguments.By.Value = "xpath"; ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click(); } }