Hello,
After recording the steps for a simple onboarding with swipe gesture in AN device, the code in Ruby throws me an error when I tried to run it in Visual Code.
def test_OnBoarding_DANSwipe @driver.swipe 852, 1465, 0, 1468, 355 @driver.swipe 852, 1465, 0, 1468, 355 @driver.find_element(:xpath, "//*[@id='iconNext']").click @driver.find_element(:xpath, "//*[@id='permission_allow_button']").click end
ArgumentError: wrong number of arguments (given 5, expected 1)
I am really new with the programming language and in general with programming so I am not sure what is failing and why.
Also tried a different approach modifying the steps on AppiumStudio and got a different error when running the code that AppiumStudio provided me:
def test_OnBoardingANtest
@driver.execute_script(âseetest:client.elementSwipe(âxpath=//[@id=âviewPagerâ]", âRightâ, 2000)")
@driver.execute_script("seetest:client.elementSwipe("xpath=//[@id=âviewPagerâ]â, âRightâ, 2000)â)
@driver.find_element(:xpath, â//[@id=âiconNextâ]").click
@driver.find_element(:xpath, "//[@id=âpermission_allow_buttonâ]â).click
end
Selenium::WebDriver::Error::JavascriptError: javascript error (javascript error. Could not find a method âelementSwipeâ matching with 3 parameters)
I would appreciate your help as I donât understand if I am missing some library or if I need to modify the code somehow.