selenium (multilogin) - finished with exit code 1

160
10 декабря 2019, 17:10

в рамках работы нужно привязать тесты, к multilogin. Использую код предоставленный на их странице, в теории он должен запустить бразуер мультилогина и открыть страницу, но ничего не происходит и получаю данную ошибку. https://docs.multilogin.com/l/ru/article/ufxks62hb4-selenium

ссылка на докуменатацию выше. Порт прописал в том файле

    import org.junit.Assert;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class BrowserProfile {
    public static void main(String[] args) throws Exception {
        BrowserProfile bp = new BrowserProfile();
        //TODO replace with existing profile ID. Define the ID of the browser profile, where the code will be executed.
        String profileId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
        //Define DesiredCapabilities
        DesiredCapabilities dc = new DesiredCapabilities();
        //Instantiate the Remote Web Driver to connect to the browser profile launched by startProfile method
        RemoteWebDriver driver = new RemoteWebDriver(new URL(bp.startProfile(profileId)), dc);
        //Perform automation
        driver.get("https://multilogin.com/");
        Assert.assertEquals("Multilogin - Replace Multiple Computers With Virtual Browser Profiles - Multilogin",driver.getTitle());
        driver.quit();
    }
    private String startProfile(String profileId) throws Exception {
        /*Send GET request to start the browser profile by profileId. Returns response in the following format:
        '{"status":"OK","value":"http://127.0.0.1:XXXXX"}', where XXXXX is the localhost port on which browser profile is
        launched. Please make sure that you have Multilogin listening port set to 35000. Otherwise please change the port
        value in the url string*/
        String url = "http://127.0.0.1:35000/api/v1/profile/start?automation=true&profileId=" + profileId;
        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
        con.setRequestMethod("GET");
        BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();
        //Get JSON text from the response and return the value by key "value"
        JSONObject jsonResponse = new JSONObject(response.toString());
        return jsonResponse.getString("value");
    }
}
READ ALSO
Список из изображений в android

Список из изображений в android

Возможно ли из этого вместо текстового списка, сделать список из изображений?

203
RecyclerView onClickListener

RecyclerView onClickListener

Можно ли в RecyclerView прослушать нажатия и как это сделать , если образец layout повторяется несколько раз

240
Добавление приложение в избранное Huawei Xioami

Добавление приложение в избранное Huawei Xioami

Можно ли на Huawei и Xioami программно добавить приложение в избранное?

192
Принцип работы компилятора javac [закрыт]

Принцип работы компилятора javac [закрыт]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

190