I have a long form to fill with is a set of yes, no questionnaire and also a place wherein I need to fill in some textual information. The controls which are in viewport are tapped perfectly fine but as we have to tab the controls which are beyond the view port, the scroll of the view happens but the test fails with following error:
eg:
elementId 10 could not be tapped (Selenium::WebDriver::Error::UnknownError)
How do I fix it?
I am using webdriver+ruby
my method to do the same is something like this:
def answer_questions(answers)
if answers[“answerType”]==‘YesNo’
driver.find_element(:xpath, “//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[@name=’#{answers[“question”]}’]/UIAButton[@name=’#{answers[“answer”]}’]”).click
elsif answers[“answerType”]==‘FreeText’
driver.find_element(:xpath, “//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[@name=’#{answers[“question”]}’]/UIATextView”).send_keys answers[“answer”]
else
raise “Couldn’t understand the answerType”
end
end