You can indicate the frame by the frame name of frame ID.
// Access second frame (frame ID 1) in the page
client.execute('document.getElementsByTagName("iframe")[1].contentWindow.document.getElementById("button").click()');
By default, an access to an element in the first frame in the page (frame ID 0) is supported without any need to indicate the frame, so you may try to access elements in the first frame without the need to indicate the frame first.