Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
Getting different results when clicking a specific element

Can someone help me why i am getting different result tho i am clicking the correct element.

Here's the code for the step definition file:

When(/^I select a Product from search results$/, async function () {
  const {
    name,
    price,
    retailer,
  } = await universalHeader.selectProductFromResults()
  await this.setTestData('productName', name)
  await this.setTestData('productPrice', price)
  await this.setTestData('productRetailer', retailer)
})

And for the index file:

async selectProductFromResults() {
    const products = await $$(selectors.productCards)
    const product = await common.getRandomNumber(products)
    const name = await (await $(`${selectors.productName}`)).getText()
    const price = await (await $(`${selectors.productPrice}`)).getText()
    const retailer = await (await $(`${selectors.productRetailer}`)).getText()
    retailer.replace('Sold by ', '')
    await product.click()
    return {
      name,
      price,
      retailer,
    }
  }

Please see the screenshot below for the issue encountered screenshot

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda