如果使用从本地xcode生成的.app文件但不使用从CI或Apple应用商店生成的IPA / .app文件,则Webview是可见的

时间:2019-05-15 08:11:47

标签: ios appium appium-ios

此代码在运行从本地.app生成的.app文件时工作正常,但无法从hockeyapp ior应用商店中获取运行的.app / IPA文件时的webview

def switch_context(context, next_element)
   puts "Starts switching context"
   puts available_contexts
   #binding.pry
   contexts = available_contexts
   i = 1
   if context == 'native'
     set_context("NATIVE_APP")
   else
     begin
       while i < contexts.size
         puts "Webview switching starting from front"
         puts "Switching to new context #{i}"
         set_context(available_contexts[i])
         i += 1
         sleep 1
         is_present = exists {find_element(:xpath, "//*[@id='#{next_element}']")}
         puts "Element is #{is_present} present"
         if is_present #check if context has web element
           puts "Context found"
           break
         end
     end
  end
end

0 个答案:

没有答案