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>So i figured it out.</p>

<pre><code>import subprocess
subprocess.call(["adb", "shell", "input keyevent 27"]) # capture
subprocess.call(["adb", "shell", "input tap 1000 1500"]) # accept the captured image
</code></pre>

android python selenium adb