Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
HTTP client in Protractor not performing POST request

I tried the code below but unable to do the post request when passing the variable to the path

var projectId = browser.driver.findElement(By.xpath("//data[contains(text(),'0')]"));
projectId.getAttribute('value');
var projectIdValue = projectId.getText();
projectIdValue.then(function(text) {
console.log(text);
const http = new HttpClient("https://xxxx/abc/d/");
console.log("http object data:"+ http.baseUrl);
var postResponse = http.post("/"++projectIdValue,'{"jsonrpc": "2.0", "id": 1, "method": "some method", "params":["100000",true]}','"Content-Type": "application/json');
http.failOnError = true;
expect(postResponse.statusCode).toEqual(200);

Tried passing Variable directly its working fine:

 var projectIdValue = "127df5bc43a14059b2afa0aa78f19b0d";
//postResponse = http.post("/127df5bc43a14059b2afa0aa78f19b0d",'{"jsonrpc": "2.0", "id": 1, "method": "some method", "params":["0x989680",true]}','"Content-Type": "application/json');
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda