How to click accept button after taking photo in selenium
<p>I have used</p>

<pre><code>self.driver.keyevent(27)
</code></pre>

<p>to capture an image in Python with <code>selenium</code>. However, the screen that I get is as shown below.</p>

<p>Basically I need to click the accept button (with red border) so that the image capture is complete. I know, that I can use in adb shell, </p>

<pre><code>input tap 1000 1500
</code></pre>

<p>and it works great. But how do I achieve the same using the Python script?</p>

<p><a href="http://i.stack.imgur.com/YaOsU.png" rel="nofollow"><img src="http://i.stack.imgur.com/YaOsU.png" alt="enter image description here"></a> </p>

<p>Even just a way to execute this via the selenium script would be OK for me</p>

<pre><code>input tap 1000 1500
</code></pre>

<p>Something like self.driver.execute("adb shell input tap 1000 1500");</p>

<p>In Python, it is uncommon to click on an element by its coordinates, can you please try looking for this accept buttons's Xpath or Css selector expression? </p>

<p>For Android testing, you may consider using <a href="http://selendroid.io/" rel="nofollow">this tool</a></p>

<p>Below is a Python code snippet about how to click on a pair coordinates, as you can see, you need to use an element as reference.</p>

<pre><code>from selenium import webdriver
driver = webdriver.Firefox() //Or whichever browser you prefer
driver.get("your url")
reference=driver.find_elements_by_xpath("Your xpath here")

action = webdriver.common.action_chains.ActionChains(driver)
action.move_to_element_with_offset(reference, X, Y)
action.click()
action.perform()
</code></pre>

<p>Since you need to locate an element as reference anyway, why not simply click on this element directly without using coordinates?</p>

android python selenium adb