2016-03-31 18 views
0

Ben Selenyum'u kullanarak Mac'te Firefox'un Kimlik Doğrulama iletişim kutusu nasıl kullanılır?

Firefox

on run ARGV 
    delay 10 
    tell application "plugin-container" 
     activate 
    end tell 

    tell application "System Events" 
     if UI elements enabled then 
      tell process "Firefox" 
       set frontmost to true 
      end tell 

      if length of ARGV < 2 then 
       display dialog "Usage: FileName UserName Password" 
       return 
      end if 

      keystroke item 1 of ARGV 
      keystroke tab 
      keystroke item 2 of ARGV 
      keystroke return 


     else 
      tell application "System Preferences" 
       activate 
       set current pane to pane "com.apple.preference.universalaccess" 
       display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\"" 
      end tell 
     end if 
    end tell 
end run 
yetkilendirme kimlik bilgilerini işlemek için AppleScript ile oluşturulan aşağıdaki uygulamayı kullanarak Ve selenyum kodu sorunudur

String[] dialog = new String[]{ "src/test/resources/AuthenticationFF.app","UserName","Password" }; 
    //First String in the application name. Must be in your project folder. 
    // Second is UserName to log in 
    // Third is Password. 
    Runtime.getRuntime().exec(dialog); 

uygulamayı çağırmak için aşağıdaki selenyum kodu kullanıyorum, Uygulamaya erişmeye çalışırken aşağıdaki hatayı alıyorum:

"src/test/resources/FF.app" programı çalıştırılamıyor: hata = 13, İzin reddedildi

Lütfen bunu önerin. Çok teşekkürler

cevap

0

I/test/kaynaklar/AuthenticationFF.app/İçerik/MacOS/uygulamasısrc için uygulama yolunu değiştirerek izni reddedildi hata sabit, şimdi bunun ekleme olmadığı için AppleScript'i tekrar gerekiyor Kimlik doğrulama kutusuna kullanıcı + şifre.

İlgili konular