from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Remote("http://127.0.0.1:7993", { "browserName": "Ranorex", "rx:app": "Calc", "rx:args": "", "rx:force": True, "rx:whitelist": ["Calculator", "Calc"]}) print("Calc application opened: " + driver.title) button2 = driver.find_element_by_xpath("/winapp//button[@automationid='num2Button']") print("Calc button 2 get handle") button2.click() print("Calc button 2 clicked") driver.find_element_by_xpath("/winapp//button[@automationid='num1Button']").click() print("Calc button 1 clicked") driver.find_element_by_xpath("/winapp//button[@automationid='multiplyButton']").click() print("Calc button * clicked") driver.find_element_by_xpath("/winapp//button[@automationid='num2Button']").click() print("Calc button 2 clicked") driver.find_element_by_xpath("/form").send_keys("=") print("Calc sent key =") result = driver.find_element_by_xpath("/winapp//text[@automationid='NormalOutput']").text print("result: " + result) driver.close()