<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Selenium FF WebDriver 加載firebug 和設置代理

      首先這次使用的webDriver for Firefox的

      由于項目的原因,需要在測試的時候加載Firebug和使用vpn,加載代理

      Firefox 加載代理,可以從FF菜單上看,代理分為好幾種

      我這里使用的是type 為2 的情況

      FirefoxProfile profile = new FirefoxProfile();
              profile.setPreference("network.proxy.type", 2);
              profile.setPreference("network.proxy.autoconfig_url", "http://proxy.myweb.com:8083"); //自動代理配置
      WebDriver driver = new FirefoxDriver(profile);

      如果type 為1 ,需要這么設置

      FirefoxProfile profile = new FirefoxProfile();
              profile.setPreference("network.proxy.type", 1);
          
           
              profile.setPreference("network.proxy.http", "proxy.domain.example.com");
              profile.setPreference("network.proxy.http_port", 8080);
              profile.setPreference("network.proxy.ssl", "proxy.domain.example.com");
              profile.setPreference("network.proxy.ssl_port", 8080);
              profile.setPreference("network.proxy.ftp", "proxy.domain.example.com");
              profile.setPreference("network.proxy.ftp_port", 8080);
              profile.setPreference("network.proxy.socks", "proxy.domain.example.com");
              profile.setPreference("network.proxy.socks_port", 8080);
      WebDriver driver = new FirefoxDriver(profile);

       

      public class sfLogin {
          static String company="autoPM2CandU";
          static String user="athompson";
          static String password="pwd";
      
          public static void main(String[] args) {
              // TODO Auto-generated method stub
              WindowsUtils.tryToKillByName("firefox.exe");
              WindowsUtils.getProgramFilesPath();
              WebDriver driver=DriverFactory.getFirefoxDriver();
              driver.get("https://qaautocand.successfactors.com/login");
              driver.manage().window().maximize();
              driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
              driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
              
              WebElement comp=driver.findElement(By.xpath("http://*[@id='company']"));
              Actions actions =new Actions(driver);
              actions.sendKeys(Keys.F12).perform();//.keyUp(Keys.F12)
              WebElement username=driver.findElement(By.xpath("http://*[@id='username']"));
              WebElement passwordHints=driver.findElement(By.xpath("http://*[@id='passwordHints']"));
              
              passwordHints.click();
              WebElement pw=driver.findElement(By.xpath("http://*[@id='password']"));
              
              WebElement login=driver.findElement(By.xpath("http://*[@id='loginSubmitBtn']"));
              comp.sendKeys(company);
              username.sendKeys(user);
              passwordHints.click();
              pw.sendKeys(password);
              login.submit();
              
              WebElement home=driver.findElement(By.xpath("http://*[@id='8:label']"));
              
              actions.moveToElement(home).click().build().perform();
              WebElement performance=driver.findElement(By.xpath("http://*[@id='10:2']"));
              performance.click();
              
              
              WebElement endBox=driver.findElement(By.xpath("http://*[@id='tablist']/tbody/tr[2]/td/div/div/div/table/tbody/tr[3]/td[2]/a"));
              
              endBox.click();
              
              WebElement auditTrailButton =driver.findElement(By.xpath("http://*[@id='form_list_table']/tbody/tr/td[10]/a[2]/img"));
              auditTrailButton.click();
              
              WebElement action =driver.findElement(By.xpath("http://*[@id='contentBodyTable']/tbody/tr[2]/td/div[2]/div/div[2]/div/div/div[2]/div/table/tbody/tr/td/table[2]/tbody/tr[2]/td/table/tbody/tr[4]/td/table/tbody/tr[4]/td[9]"));
              
              System.out.println(action.getText());
              
              
              
              
              
          }
      
      }
      View Code

       

      如果需要加載firebug

          File file=new File("d:\\firebug-2.0.4-fx.xpi");//設置Firebug路徑
              FirefoxProfile profile = new FirefoxProfile(); 
              profile.setPreference("network.proxy.type", 1);
              
              profile.setPreference("network.proxy.http", "proxy.domain.example.com");
              profile.setPreference("network.proxy.http_port", 8080);
              profile.setPreference("network.proxy.ssl", "proxy.domain.example.com");
              profile.setPreference("network.proxy.ssl_port", 8080);
              profile.setPreference("network.proxy.ftp", "proxy.domain.example.com");
              profile.setPreference("network.proxy.ftp_port", 8080);
              profile.setPreference("network.proxy.socks", "proxy.domain.example.com");
              profile.setPreference("network.proxy.socks_port", 8080);
              
       
              try {
                  profile.addExtension(file);
                  profile.setPreference("extensions.firebug.currentVersion", "2.0.4");//設置firebug 版本
              } catch (IOException e3) {
                  // TODO Auto-generated catch block
                  e3.printStackTrace();
              }
           
              WebDriver driver = new FirefoxDriver(profile);
              return driver;
              

      如果需要在運行時候firebug執行

      Actions actions =new Actions(driver);
      actions.sendKeys(Keys.F12).perform();//使用F12調出firebug

       

      擴展,為什么這么設置

      你可以使用about:config 在Firefox里邊看看

       

      posted @ 2014-09-27 22:26  to be crazy  閱讀(5375)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 日韩大片高清播放器| 日韩一区在线中文字幕| 丰满熟妇人妻中文字幕| 好男人官网资源在线观看| 香蕉久久精品日日躁夜夜躁夏 | 成熟了的熟妇毛茸茸| 日本久久99成人网站| 色综合久久一区二区三区| 亚洲成人av综合一区| 高清自拍亚洲精品二区| 亚洲中文字幕日产无码成人片| 丰满少妇人妻久久久久久| 国产无套内射又大又猛又粗又爽| 国产午夜精品亚洲精品国产 | 蒲城县| 色偷偷成人综合亚洲精品| 国产午夜福利免费入口| 亚洲一区在线观看青青蜜臀| 午夜爽爽爽男女免费观看影院| 亚洲精品中文字幕尤物综合| 国产熟女一区二区三区四区| 日本中文字幕不卡在线一区二区| 国产h视频在线观看| 久久精品国产亚洲av天海翼| а天堂中文最新一区二区三区| 无码全黄毛片免费看| 国产在线欧美日韩精品一区| 久久99国产精品尤物| 伊人久久大香线蕉AV网| 男女扒开双腿猛进入爽爽免费看 | 日韩一区国产二区欧美三区| 人妻中文字幕精品一页| 国产一区日韩二区欧美三区| 久久不见久久见免费影院www日本| 激情啪啪啪一区二区三区| AV区无码字幕中文色| 99riav国产精品视频| 国产漂亮白嫩美女在线观看| 亚洲熟妇AV午夜无码不卡| 国精偷拍一区二区三区| 99精品国产在热久久无|