Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

63
Views
Nueva reliquia seleccionando la primera opción desplegable disponible del menú

Estoy atascado en esto y espero que me puedas señalar en la dirección correcta.

Estoy usando una nueva herramienta de monitoreo de reliquias y necesito crear una prueba de monitoreo del viaje típico del usuario de comercio electrónico, buscar, seleccionar un producto, seleccionar un tamaño y luego agregarlo a la bolsa.

El problema que tengo es que algunos tamaños de productos se agotan y eso rompe mi prueba. Tengo el siguiente código que me permite elegir un producto específico, pero ¿alguien sabe cómo seleccionar la primera opción disponible?

Cualquier ayuda sería apreciada.

Gracias

 //Example: Selecting an option and retrieving the selected label/value var By = $driver.By, selectbox; // ----------------------------------------------------------------------------- // // Helper function that returns the first selected option given a select element function findSelected(select) { var d = $driver.promise.defer(); select.findElements(By.tagName('option')).then(function (options) { options.forEach(function(option) { option.isSelected().then(function(selected) { if (selected) { d.fulfill(option); } }); }); }); return d.promise; } // ----------------------------------------------------------------------------- // // Load the page $browser.get("http://www.w3schools.com/html/tryit.asp?filename=tryhtml_select2").then(function(){ // Focus the iframe $browser.switchTo().frame("iframeResult"); // Click on select return $browser.waitForAndFindElement(By.name("cars"), 15000).then(function(elem) { selectbox = elem; selectbox.click(); }); }).then(function() { // Select an option return selectbox.findElement(By.css("option[value='audi']")).click(); })
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!