测试工具

Selenium

确保您的数字产品符合全球标准。通过Selenium和代理模拟来自不同地区的真实用户行为,以进行准确的分析。

Selenium
  1. Firstly, you need to know that Selenium supports five programming languages: Java, C#, Python, Ruby, Javascript (Node). Depending on language you use, there are different ways to set up proxies

  2. Secondly, you need to choose WebDriver you want to use. Selenium offers WebDrivers to all the most popular browsers (you can see all supported drivers here). In our tutorial we'd like to use Google Chrome Driver

  3. There are some code examples for your preferred programming language and Google Chrome Driver

    package chromeScripts;
    
    import java.io.File;
    import org.openqa.selenium.By;
    import org.openqa.selenium.Proxy;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.chrome.ChromeDriverService;
    import org.openqa.selenium.chrome.ChromeOptions;
    
    public class Example {
    
        public static void main(String[] args) {
            
            String ProxyServer = "proxy.froxy.com";
            int ProxyPort = 9000;
            
            String sHttpProxy = ProxyServer + ":" + ProxyPort;
            
            Proxy proxy = new Proxy();
            
            proxy.setHttpProxy(sHttpProxy);
            
            ChromeDriverService service = new ChromeDriverService.Builder()
                                        .usingDriverExecutable(new File("PATH TO WEBDRIVER"))
                                        .usingAnyFreePort()
                                        .build();
            ChromeOptions options = new ChromeOptions();
            
            options.setCapability("proxy", proxy);
            
            options.merge(options);    
            
            WebDriver driver=new ChromeDriver(service, options);
            driver.get("http://froxy.com/api/detect-ip/");
            WebElement body = driver.findElement(By.tagName("body"));
            String bodyText = body.getText();
            System.out.println(bodyText);
        }
    }
    

    You're able to run all of these commands in your Terminal/Command Prompt window

  4. To set up proxy connection please use proxy.froxy.com:9000 line within the punctuation marks (''). Depending on your type of language, punctuation may differ

    • Java:
        String ProxyServer = "proxy.froxy.com";
        int ProxyPort = 9000;
      
    • C#:
        HttpProxy = "proxy.froxy.com:9000"
      
    • Python:
         HOSTNAME = 'proxy.froxy.com'
         PORT = '9000'
      
    • Ruby:
         proxy = Selenium::WebDriver::Proxy.new(http: "proxy.froxy.com:9000")
      
    • Javascript (Node):
        let addr = 'proxy.froxy.com:9000'
      

    All necessary data about server, port, login and password you can get from your Froxy Dashboard

成功创业

开始使用Froxy进行测试与QA

Froxy提供专为模拟现实世界条件进行全面测试的代理。访问全球IP地址,确保您的应用程序和网站无缝运行。

让您的测试过程无缝进行。选择一个计划,今天就开始吧。