Instruction: Click on the numbers in ascending order.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/ascending-numbers.html

1  2  3  4  5

#area_svg { width: 160px; height: 160px; }
#highlight {  }
.highlight-green { fill: green; }
.highlight-red { fill: red; }
.highlight-blue { fill: blue; }

core.EPISODE_MAX_TIME = 10000;
var TOTAL_RECTS = 5;
var QUERY_PADDING = 50;
var MARGIN_PADDING = 5;

var rectOverlap = function(rect1, rect2){
  var PADDING = 15;
  var o1 = (rect1.right + PADDING) < rect2.left;
  var o2 = rect1.left > (rect2.right + PADDING);
  var o3 = (rect1.bottom + PADDING) < rect2.top;
  var o4 = rect1.top > (rect2.bottom + PADDING);

  var overlap = !(o1 || o2 || o3 || o4);
  return overlap;
}

var hideNumberText = function(){
  var nums = d3.selectAll('svg text')[0];
  for(var i=0;i<nums.length;i++){
    var num = nums[i];
    var pos = num.getBoundingClientRect();
    d3.select('svg')
      .append('rect')
      .attr('class', 'rect')
      .attr('x', pos.left - MARGIN_PADDING)
      .attr('y', pos.top - QUERY_PADDING)
      .attr('width', 20)
      .attr('height', 20)
      .attr('data-index', i+1);
  }

  d3.selectAll('svg text').remove();
  d3.select('svg rect').remove(); // remove first rect
  d3.selectAll('svg rect').on('click', function(){
    var rectIndex = this.getAttribute('data-index');
    var firstRect = d3.select('svg rect')[0][0].getAttribute('data-index');
    var remainingNumbers = d3.selectAll('svg rect')[0].length;
    if(rectIndex === firstRect && remainingNumbers !== 1){
      d3.select(this).remove();
    } else if(rectIndex === firstRect && remainingNumbers === 1){
      core.endEpisode(1.0, true);
    } else {
      var diff = TOTAL_RECTS - remainingNumbers;
      var reward = diff/TOTAL_RECTS;
      core.endEpisode(reward, true);
    }
  });
}

// create a problem instance
var genProblem = function() {
  d3.selectAll('svg > *').remove();
  var svg =  d3.select('svg');

  var shapeSize = core.randi(15,25);
  // generate a new random grid of shapes
  var renderedShapes = 0;
  while(renderedShapes < TOTAL_RECTS){
    var x = Math.random() * 100 + 20;
    var y = Math.random() * 100 + 20;
    var pos = {x:x, y:y};

    svg
      .append('text')
      .attr('class', 'text')
      .text(renderedShapes+1)
      .attr('x', x)
      .attr('y', y)
      .attr('font-size', 20);

    var currentSquares = d3.selectAll('svg text')[0];
    var lastDrawn = currentSquares[currentSquares.length-1];
    var overlap;
    for(var s=0;s<currentSquares.length-1;s++){
      overlap = rectOverlap(currentSquares[s].getBoundingClientRect(), lastDrawn.getBoundingClientRect());
      if(overlap) break;
    }

    if(overlap) {
      lastDrawn.remove();
      continue;
    } else renderedShapes++;
  }

  missedFrames = 0;
  exitTime = new Date().getTime();

  d3.selectAll('svg text').on('click', function(){
    if(this.innerHTML !== '1'){
      core.endEpisode(-1.0);
    } else {
      hideNumberText();
    }
  });

}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click('2')

In order to accomplish the goal of clicking on the numbers in ascending order, the next action should be:

1  2  3  4  5

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("2")
  locator resolved to <title bid="2" browsergym_set_of_marks="0" browsergym_v…>Ascending Numbers Task</title>
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
============================================================

Executing browser actions: click('4')

In order to accomplish my goal, I need to click on the number 4 next.

1  2  3  4  5

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("4")
  locator resolved to <script bid="4" src="../core/core.js" browsergym_set_of_…></script>
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
============================================================

Executing browser actions: click("5")

1  2  3  4  5

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("5")
  locator resolved to <script bid="5" src="../core/d3.v3.min.js" browsergym_se…></script>
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
============================================================

Executing browser actions: click("5")

In order to accomplish my goal, I need to click on the number "5" next.

1  2  3  4  5

Executing browser actions: click("5")

1  2  3  4  5

Executing browser actions: click("5")

In order to accomplish my goal I need to click on the button with bid 5.

1  2  3  4  5

Too many errors encountered. Task failed.

No observation

All done! What's next on the agenda?

No observation


Instruction: Create a line that bisects the angle evenly in two, then press submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/bisect-angle.html

Submit

#area { position: relative; height: 160px; width: 160px; }
#area svg { width: 150px; height: 130px; }
#subbtn { left: 30px; bottom: 5px; position: absolute; }

var RADIUS_PADDING = 3; // 3px for circle radius
var QUERY_PADDING = 50; // 50px for #query height

function graphClicked(event) {
  var x = event.pageX;
  var y = event.pageY;
  var divWidth = document.getElementById('svg-grid').clientWidth;
  var divHeight = document.getElementById('svg-grid').clientHeight;

  var svg = d3.select('svg');

  d3.selectAll('.blue').remove();

  shapes.drawCircles([{ class: 'blue', id: 'blue-circle', cx: x, cy: (y-QUERY_PADDING),
    r: 3.5, fill: 'blue' }], svg);

  var blueCircle = d3.select('#blue-circle')[0][0].getBBox();
  var initCircle = d3.selectAll('.init-blue')[0][0].getBBox();

  shapes.drawLines([{ stroke: 'blue', class: 'blue', x1: (blueCircle.x + RADIUS_PADDING),
    x2: (initCircle.x + RADIUS_PADDING), y1: (blueCircle.y + RADIUS_PADDING),
    y2: (initCircle.y + RADIUS_PADDING) }], svg);
}

var pointsSpacedOut = function(point, existingPoints){
  for(var i=0;i<existingPoints.length;i++){
    var xDiff = Math.abs(point.cx - existingPoints[i].cx);
    var yDiff = Math.abs(point.cy - existingPoints[i].cy);
    if(xDiff < 40 && yDiff < 40) return false;
  }
  return true;
}

var connectPoints = function(){
  var svg = d3.select('svg');
  var blueCircle = svg.select('.init-blue')[0][0].getBBox();

  var blackCircles = svg.selectAll('.init-black')[0];
  var lines = [];
  for(var i=0;i<blackCircles.length;i++){
    var currentCircle = blackCircles[i].getBBox();
    lines.push({ x1: (blueCircle.x + RADIUS_PADDING), x2: (currentCircle.x + RADIUS_PADDING),
      y1: (blueCircle.y + RADIUS_PADDING), y2: (currentCircle.y + RADIUS_PADDING) });
  }
  shapes.drawLines(lines, svg);
}

// given pointA, pointB and the vertex that is joined to both of these points,
// return the angle made by all three points.
var findAngle = function(pointA,pointB, pointVertex) {
  var pAV = Math.sqrt(Math.pow(pointVertex.x-pointA.x,2) + Math.pow(pointVertex.y-pointA.y,2));
  var pBV = Math.sqrt(Math.pow(pointVertex.x-pointB.x,2) + Math.pow(pointVertex.y-pointB.y,2));
  var pApB = Math.sqrt(Math.pow(pointB.x-pointA.x,2) + Math.pow(pointB.y-pointA.y,2));
  var radAngle = Math.acos((pBV*pBV+pAV*pAV-pApB*pApB)/(2*pBV*pAV));
  return (radAngle*180)/ Math.PI; // return in degrees
}

var computeDistances = function(){
  var pointA = d3.selectAll('.init-black')[0][0].getBBox();
  var pointB = d3.selectAll('.init-black')[0][1].getBBox();
  var pointVertex = d3.select('.init-blue')[0][0].getBBox();

  var totalAngle = findAngle(pointA, pointB, pointVertex);
  var correctPoint = findMidpoint(pointA, pointB, pointVertex);

  // error handle for submitting without any shapes
  if(d3.select('#blue-circle')[0][0] === null) {
    core.endEpisode(-1, false);
    return;
  }
  var pointC = d3.select('#blue-circle')[0][0].getBBox();
  var userAngleA = findAngle(pointA, pointC, pointVertex);
  var userAngleB = findAngle(pointB, pointC, pointVertex);
  var largerAngle = userAngleA > userAngleB ? userAngleA : userAngleB;

  var score = (totalAngle - largerAngle) / (totalAngle/2);

  if(userAngleA > totalAngle || userAngleB > totalAngle) core.endEpisode(-1.0, false);
  else core.endEpisode(score, true);
}

var findMidpoint = function(pointA, pointB, pointVertex){
  var midpoint = {};
  midpoint.x = (pointA.x + pointB.x)/2;
  midpoint.y = (pointA.y + pointB.y)/2;

  var svg = d3.select('svg');

  shapes.drawCircles([{ class: 'green', cx: midpoint.x, cy: midpoint.y, r: 3.5, fill: 'green' }], svg);
  shapes.drawLines([{ stroke: 'green', x1: (midpoint.x), x2: (pointVertex.x + RADIUS_PADDING),
    y1: (midpoint.y), y2: (pointVertex.y + RADIUS_PADDING) }], svg);
}

// generate two random, initial reference points. first point is black,
// second point is blue and acts as the vertex between the first point
// and the user-clicked third point.
var startingPoints = function(){
  var jsonCircles = [{ cx: core.randi(5, 135), cy: core.randi(10, 120), fill: 'blue', class: 'init-blue', r: 3.5 }];
  while(jsonCircles.length < 3){
    var newCircle = { cx: core.randi(5,135), cy: core.randi(10, 120), fill : 'black', class: 'init-black', r: 3.5 };
    var usablePoint = pointsSpacedOut(newCircle, jsonCircles)
    console.log
    if(!usablePoint) continue;
    else jsonCircles.push(newCircle);
  }

  return jsonCircles;
}

var genProblem = function() {
  var svg = d3.select('svg');
  svg.selectAll('*').remove();

  var jsonCircles = startingPoints();
  shapes.drawCircles(jsonCircles, svg);
  connectPoints();

  svg.on('click', function(){ graphClicked(event); });

  d3.select('#subbtn').on('click', function(){
    computeDistances();
  });
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click("13")

To bisect the angle evenly in two, we need to interact with the image on the page. Let's perform the action of creating a line that bisects the angle evenly in two by clicking on the image.

Submit

Executing browser actions: hover("13")

To bisect the angle evenly in two, I need to create a line. Let's hover over the image to find the midpoint for the line.

Submit

Executing browser actions:

Submit

Executing browser actions: click("13")

In order to accomplish my goal of creating a line that bisects the angle evenly in two, I need to click on the image with bid 13.

Submit

Executing browser actions: click("13")

# Action
To bisect the angle evenly in two, I will click on the image to create a line that bisects the angle, then I will press submit.

Submit

Executing browser actions:

Submit

Executing browser actions: click("13")

Submit

Executing browser actions:

Submit

Executing browser actions: click("14")

In order to accomplish my goal, I need to create a line that bisects the angle evenly in two. Then, I should click on the "Submit" button.

Submit

Agent reached maximum number of iterations


Instruction: Book the shortest one-way flight from: BLV to: Charlottesville, VA on 12/28/2016.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/book-flight.html

#area { height: 156px; position: relative; overflow-y: scroll;
  background-image: -webkit-linear-gradient(top, rgb(207, 223, 238) 0px, rgb(235, 240, 246) 100%); }
#header-book { font-size: 10px; font-weight: bold; font-family: Helvetica,Arial,sans-serif; margin-left: 2px; }
#search { margin: 2px; width: 126px; border: 1px solid #B3B3B3; border-radius: 3px; cursor: pointer;
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fdd774),color-stop(1,#edb82e)); }

.input-container { padding: 2px; }
.flight-input { border: 1px solid #666; padding: 2px; border-radius: 3px; cursor: pointer; }
.ui-menu { font-size: 10px; width: 126px !important; }
.ui-autocomplete { max-height: 80px; overflow-y: auto; overflow-x: hidden; }

.departure-container { margin-top: 15px; }
.departure-header{ background: #039; color: #FFF; font-weight: bold; padding: 2px; width: 124px;
  border-right-width: 1px; border-left-width: 1px; border-top-left-radius: 3px; border-top-right-radius: 3px; }
.departure-container .input-container { padding: 0 2px; background-color: #FFF; width: 124px;
  border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; }
.departure-container input { width: 100px !important; margin: 2px 8px; height: 10px; }
.search-container { margin-top: 3px; }

div.ui-datepicker { font-size: 7px; }
p { margin: 0; padding: 0; }
input { width: 100px; display: inline-block; }
.hide { display: none; }

.flight-header { margin: 2px; }
.flight-header button { height: 15px; width: 25px; font-size: 8px;
  border-radius: 3px; padding: 0; margin-left: -1px;
  linear-gradient(to bottom,#fff 0,#fefefe 10%,#d0e0ed 65%,#d0e0ed 90%,#d2dfef 94%,#d0e0ed 97%,#c2cfd8 100%); }
.flight-summary { margin: 2px 0; text-align: center; color: #FFF; width: 138px;
  background-color: #333; padding: 2px; }
.flight { box-shadow: 0 1px 4px rgba(0,0,0,.3); background-color: #FFF;
  width: 140px; padding: 2px; border-radius: 3px; margin: 3px 1px; }
.label-container { display: inline-block; width: 29%; vertical-align: top; }
.label-container label { margin-left: 2px; color: #666; }
.details-container { display: inline-block; width: 69%; margin: 1px 0; }
.details-container div { margin-left: 2px; }

.book { text-align: center; }
.book button { margin: 2px; width: 126px; border: 1px solid #B3B3B3;
  border-radius: 3px; cursor: pointer;
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fdd774),color-stop(1,#edb82e)); }
.error { border: 1px solid red !important; }

core.EPISODE_MAX_TIME = 30000;

var START_DATE = new Date(2016, 09, 1); // October 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
var DAY_MILLISECONDS = 86400000;
var MAX_FLIGHTS = 5;
var DESIRED_FLIGHT = ['cheapest', 'shortest'];
var MAX_PRICE = 1200; // in USD.

var FLIGHT_NAV = `
<button id="menu-back">Back</button>

   |

`

var FLIGHT_TEMPLATE = `

Depart:

Arrives:

Duration:

  <button class="flight-price">Book flight for </button>

`

var createFlightHeader = function(departCity, arriveCity, departDate){
  var departCode = departCity.replace(/(\s\()|(\))/g, '_').split('_')[1];
  var arriveCode = arriveCity.replace(/(\s\()|(\))/g, '_').split('_')[1];
  var div = document.createElement('div');
  div.setAttribute('class', 'flight-header');
  div.innerHTML = FLIGHT_NAV;

  div.getElementsByClassName('flight-codes')[0].innerHTML = departCode + " to " + arriveCode;
  div.getElementsByClassName('flight-date')[0].innerHTML = departDate;

  $('#results').append(div);
}

var createFlightElem = function(result, index){
  var div = document.createElement('div');
  div.setAttribute('class', 'flight');
  div.setAttribute('data-result', index);
  div.innerHTML = FLIGHT_TEMPLATE;

  div.getElementsByClassName('depart-time')[0].innerHTML = result.depart.time;
  div.getElementsByClassName('depart-day')[0].innerHTML = result.depart.day;
  div.getElementsByClassName('depart-city')[0].innerHTML = result.depart.city;

  div.getElementsByClassName('arrive-time')[0].innerHTML = result.arrive.time;
  div.getElementsByClassName('arrive-day')[0].innerHTML = result.arrive.day;
  div.getElementsByClassName('arrive-city')[0].innerHTML = result.arrive.city;

  div.getElementsByClassName('time-duration')[0].innerHTML = result.userDuration;
  div.getElementsByClassName('time-duration')[0].setAttribute('data-duration', result.duration);
  div.getElementsByClassName('flight-price')[0].innerHTML += '$' + result.price;
  div.getElementsByClassName('flight-price')[0].setAttribute('data-price', result.price);

  $('#results').append(div);
}

var generateFlights = function(departCity, arriveCity, day){
  var results = [];
  var totalFlights = core.randi(3, MAX_FLIGHTS);
  var flightStart = new Date(Date.parse(day));
  var flightStartMax = new Date(Date.parse(day) + DAY_MILLISECONDS);
  var flightEnd = new Date(Date.parse(day) + DAY_MILLISECONDS*1.5);
  for(var i=0;i<totalFlights;i++){
    var result = {}
    result.depart = {};
    result.arrive = {};

    var departDate = ui_utils.randomDate(flightStart, flightStartMax);
    var arriveDate = ui_utils.randomDate(departDate, flightEnd);

    result.depart.city = departCity;
    result.depart.dateObj = departDate;
    result.depart.day = departDate.toDateString();
    result.depart.time = departDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    result.arrive.city = arriveCity;
    result.arrive.dateObj = arriveDate;
    result.arrive.day = arriveDate.toDateString();
    result.arrive.time = arriveDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    var duration = (arriveDate - departDate)
    result.userDuration = parseInt((duration / (1000*60*60)) % 60) + 'h ' + parseInt((duration / (1000*60)) % 60) + 'm';
    result.duration = duration;
    result.price = core.randi(50, MAX_PRICE);

    results.push(result);
  }
  return results;
}

var genProblem = function(){
  // clear the UI.
  if($('body').find('ui-autocomplete-input').length > 0) $('#flight-from, #flight-to').autocomplete('destroy');
  if($('body').find('hasDatepicker').length > 0) $('#datepicker').datepicker('destroy');
  $('#search').unbind('click');
  $('#area input').val('');
  $('#menu').removeClass('hide');
  $('#results').addClass('hide').empty();
  $('.error').removeClass('.error');

  var origin = core.sample(DOMESTIC_FLIGHTS);
  var splitOrigin = origin.replace(/(\s\()|(\))/g, '_').split('_');
  var cityOrigin = splitOrigin[0];
  var airportOrigin = splitOrigin[1];
  var userOrigin = core.sample([cityOrigin, airportOrigin]);

  var destination = core.sample(DOMESTIC_FLIGHTS);
  var splitDesination = destination.replace(/(\s\()|(\))/g, '_').split('_');
  var cityDesination = splitDesination[0];
  var airportDesination = splitDesination[1];
  var userDestination = core.sample([cityDesination, airportDesination]);

  var expectedDate = ui_utils.randomDate(START_DATE, END_DATE);
  var userDate = ui_utils.toDateString(expectedDate);

  var bookAction = core.sample(DESIRED_FLIGHT);

  $('#query').html('Book the ' + bookAction + ' one-way flight from: ' + userOrigin + ' to: ' +  userDestination + ' on ' + userDate + '.');

  $('#flight-from, #flight-to').autocomplete({
    source: DOMESTIC_FLIGHTS
  });

  $("#datepicker").datepicker({
    beforeShow: function (textbox, instance) {
      var txtBoxOffset = $(this).offset();
      var top = txtBoxOffset.top;
      var left = txtBoxOffset.left;
      var textBoxWidth = $(this).outerWidth();
      setTimeout(function () {
        instance.dpDiv.css({top: top-107, left: left});
      }, 0);
    },
    minDate: START_DATE,
    maxDate: END_DATE
  });

  var flightResults = generateFlights(origin, userDestination, userDate);

  $('#search').on('click', function(){
    $('#results').empty();
    $('.error').removeClass('error');
    var inputOrigin = $('#flight-from').val();
    var inputDestination = $('#flight-to').val();
    var inputDate = $('#datepicker').val();

    // input validation. if the text inputs are invalid, or blank, outline them in red.
    if(inputOrigin === '' || DOMESTIC_FLIGHTS.indexOf(inputOrigin) === -1)
      $('#flight-from').addClass('error');
    if(inputDestination === '' || DOMESTIC_FLIGHTS.indexOf(inputDestination) === -1)
      $('#flight-to').addClass('error');
    if(inputDate === '')
      $('#datepicker').addClass('error');
    if($('.error').length > 0) return;

    $('#results').removeClass('hide');
    $('#menu').addClass('hide');

    var cheapestPrice = MAX_PRICE;
    var shortest = DAY_MILLISECONDS*2;

    // create the header at the top of the flight results,
    // and allow the user to return back to search if needed.
    createFlightHeader(inputOrigin, inputDestination, inputDate);
    $('#menu-back').unbind('click');
    $('#menu-back').on('click', function(){
      $('#results').addClass('hide');
      $('#menu').removeClass('hide');
    });

    // all the shenanigans used to determine whether or not the user
    // has picked the correct flight: the origin city, the desination city,
    // the date, and whether or not it's the cheapest/shorest flight.
    var correctOrigin = inputOrigin.indexOf(userOrigin) !== -1;
    var correctDestination = inputDestination.indexOf(userDestination) !== -1;
    var correctDate = inputDate === userDate;
    if(correctOrigin && correctDestination && correctDate){
      for(var i=0;i<flightResults.length; i++){
        createFlightElem(flightResults[i]);
        if(bookAction === 'shortest' &&  flightResults[i].duration < shortest)
          shortest = flightResults[i].duration;
        if(bookAction === 'cheapest' && flightResults[i].price < cheapestPrice)
          cheapestPrice = flightResults[i].price;
      }
    } else {
      // if any of the data is incorrect, generate dynamic/fake results for the user.
      var fakeFlights = generateFlights(inputOrigin, inputDestination, inputDate);
      for(var i=0;i<fakeFlights.length; i++){
        createFlightElem(fakeFlights[i]);
      }
    }

    $('.flight-price').on('click', function(){
      var $parent = $(this).parents('.flight');
      var price = parseInt($parent.find('.flight-price').attr('data-price'));
      var duration = parseInt($parent.find('.time-duration').attr('data-duration'));
      var r = (bookAction === 'shortest' && duration === shortest) || (bookAction === 'cheapest' && price === cheapestPrice) ? 1.0 : -1.0;
      core.endEpisode(r, r > 0);
    });

  });
}

window.onload = function() {
  core.startEpisode();
}

ui-menu ui-widget ui-widget-content ui-autocomplete ui-front

ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all

Executing browser actions: fill('19', 'BLV')

In order to accomplish my goal, I need to fill in the following information:
- From: BLV
- To: Charlottesville, VA
- Departure Date: 12/28/2016

Then, I should click on the 'Search' button to find the shortest one-way flight.

##  Book Your One-Way Flight

Departure Date

Search

  * <::marker>

Belleville, IL (BLV)

1 result is available, use up and down arrow keys to navigate.

display: block; width: 127px; top: 102.594px; left: 4px;

Executing browser actions:

Executing browser actions: click('29')
select_option('29', 'Charlottesville, VA')

In order to accomplish my goal, I need to select the destination 'Charlottesville, VA' from the list.

##  Book Your One-Way Flight

Departure Date

Search

  * Belleville, IL (BLV)

1 result is available, use up and down arrow keys to navigate.

Belleville, IL (BLV)

display: none; width: 127px; top: 102.594px; left: 4px;

Executing browser actions: select_option('21', 'Charlottesville, VA')

In order to accomplish my goal, I need to select the option 'Charlottesville, VA' in the 'To:' textbox.

Error: Error: Element is not a <select> element
=========================== logs ===========================
waiting for get_by_test_id("21")
  locator resolved to <input value="" bid="21" type="text" id="flight-to" pla…/>
  selecting specified option(s)
  Element is not a <select> element
============================================================

Executing browser actions: fill('25', '12/28/2016')

In order to accomplish the goal of booking the shortest one-way flight from BLV to Charlottesville, VA on 12/28/2016, the next action should be to fill in the departure date.

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("25")
  locator resolved to <input readonly value="" bid="25" type="text" id="datep…/>
elementHandle.fill("12/28/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

Executing browser actions:

Executing browser actions: click('27')

In order to accomplish my goal, I need to click on the 'Search' button to find the shortest one-way flight from BLV to Charlottesville, VA on 12/28/2016.

Executing browser actions:

No observation

Agent reached maximum number of iterations


Instruction: Book the shortest one-way flight from: Cedar Rapids, IA to: Muscle Shoals, AL on 10/09/2016.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/book-flight-nodelay.html

core.EPISODE_MAX_TIME = 30000;

var START_DATE = new Date(2016, 09, 1); // October 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
var DAY_MILLISECONDS = 86400000;
var MAX_FLIGHTS = 5;
var DESIRED_FLIGHT = ['cheapest', 'shortest'];
var MAX_PRICE = 1200; // in USD.

var FLIGHT_NAV = `
<button id="menu-back">Back</button>

   |

`

var FLIGHT_TEMPLATE = `

Depart:

Arrives:

Duration:

  <button class="flight-price">Book flight for </button>

`

var createFlightHeader = function(departCity, arriveCity, departDate){
  var departCode = departCity.replace(/(\s\()|(\))/g, '_').split('_')[1];
  var arriveCode = arriveCity.replace(/(\s\()|(\))/g, '_').split('_')[1];
  var div = document.createElement('div');
  div.setAttribute('class', 'flight-header');
  div.innerHTML = FLIGHT_NAV;

  div.getElementsByClassName('flight-codes')[0].innerHTML = departCode + " to " + arriveCode;
  div.getElementsByClassName('flight-date')[0].innerHTML = departDate;

  $('#results').append(div);
}

var createFlightElem = function(result, index){
  var div = document.createElement('div');
  div.setAttribute('class', 'flight');
  div.setAttribute('data-result', index);
  div.innerHTML = FLIGHT_TEMPLATE;

  div.getElementsByClassName('depart-time')[0].innerHTML = result.depart.time;
  div.getElementsByClassName('depart-day')[0].innerHTML = result.depart.day;
  div.getElementsByClassName('depart-city')[0].innerHTML = result.depart.city;

  div.getElementsByClassName('arrive-time')[0].innerHTML = result.arrive.time;
  div.getElementsByClassName('arrive-day')[0].innerHTML = result.arrive.day;
  div.getElementsByClassName('arrive-city')[0].innerHTML = result.arrive.city;

  div.getElementsByClassName('time-duration')[0].innerHTML = result.userDuration;
  div.getElementsByClassName('time-duration')[0].setAttribute('data-duration', result.duration);
  div.getElementsByClassName('flight-price')[0].innerHTML += '$' + result.price;
  div.getElementsByClassName('flight-price')[0].setAttribute('data-price', result.price);

  $('#results').append(div);
}

var generateFlights = function(departCity, arriveCity, day){
  var results = [];
  var totalFlights = core.randi(3, MAX_FLIGHTS);
  var flightStart = new Date(Date.parse(day));
  var flightStartMax = new Date(Date.parse(day) + DAY_MILLISECONDS);
  var flightEnd = new Date(Date.parse(day) + DAY_MILLISECONDS*1.5);
  for(var i=0;i<totalFlights;i++){
    var result = {}
    result.depart = {};
    result.arrive = {};

    var departDate = ui_utils.randomDate(flightStart, flightStartMax);
    var arriveDate = ui_utils.randomDate(departDate, flightEnd);

    result.depart.city = departCity;
    result.depart.dateObj = departDate;
    result.depart.day = departDate.toDateString();
    result.depart.time = departDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    result.arrive.city = arriveCity;
    result.arrive.dateObj = arriveDate;
    result.arrive.day = arriveDate.toDateString();
    result.arrive.time = arriveDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    var duration = (arriveDate - departDate)
    result.userDuration = parseInt((duration / (1000*60*60)) % 60) + 'h ' + parseInt((duration / (1000*60)) % 60) + 'm';
    result.duration = duration;
    result.price = core.randi(50, MAX_PRICE);

    results.push(result);
  }
  return results;
}

var genProblem = function(){
  // clear the UI.
  if($('body').find('ui-autocomplete-input').length > 0) $('#flight-from, #flight-to').autocomplete('destroy');
  if($('body').find('hasDatepicker').length > 0) $('#datepicker').datepicker('destroy');
  $('#search').unbind('click');
  $('#area input').val('');
  $('#menu').removeClass('hide');
  $('#results').addClass('hide').empty();
  $('.error').removeClass('.error');

  var origin = core.sample(DOMESTIC_FLIGHTS);
  var splitOrigin = origin.replace(/(\s\()|(\))/g, '_').split('_');
  var cityOrigin = splitOrigin[0];
  var airportOrigin = splitOrigin[1];
  var userOrigin = core.sample([cityOrigin, airportOrigin]);

  var destination = core.sample(DOMESTIC_FLIGHTS);
  var splitDesination = destination.replace(/(\s\()|(\))/g, '_').split('_');
  var cityDesination = splitDesination[0];
  var airportDesination = splitDesination[1];
  var userDestination = core.sample([cityDesination, airportDesination]);

  var expectedDate = ui_utils.randomDate(START_DATE, END_DATE);
  var userDate = ui_utils.toDateString(expectedDate);

  var bookAction = core.sample(DESIRED_FLIGHT);

  $('#query').html('Book the ' + bookAction + ' one-way flight from: ' + userOrigin + ' to: ' +  userDestination + ' on ' + userDate + '.');

  $('#flight-from, #flight-to').autocomplete({
    source: DOMESTIC_FLIGHTS,
    delay: 0
  });

  $("#datepicker").datepicker({
    beforeShow: function (textbox, instance) {
      var txtBoxOffset = $(this).offset();
      var top = txtBoxOffset.top;
      var left = txtBoxOffset.left;
      var textBoxWidth = $(this).outerWidth();
      setTimeout(function () {
        instance.dpDiv.css({top: top-107, left: left});
      }, 0);
    },
    minDate: START_DATE,
    maxDate: END_DATE,
    showAnim: ''
  });

  var flightResults = generateFlights(origin, userDestination, userDate);

  $('#search').on('click', function(){
    $('#results').empty();
    $('.error').removeClass('error');
    var inputOrigin = $('#flight-from').val();
    var inputDestination = $('#flight-to').val();
    var inputDate = $('#datepicker').val();

    // input validation. if the text inputs are invalid, or blank, outline them in red.
    if(inputOrigin === '' || DOMESTIC_FLIGHTS.indexOf(inputOrigin) === -1)
      $('#flight-from').addClass('error');
    if(inputDestination === '' || DOMESTIC_FLIGHTS.indexOf(inputDestination) === -1)
      $('#flight-to').addClass('error');
    if(inputDate === '')
      $('#datepicker').addClass('error');
    if($('.error').length > 0) return;

    $('#results').removeClass('hide');
    $('#menu').addClass('hide');

    var cheapestPrice = MAX_PRICE;
    var shortest = DAY_MILLISECONDS*2;

    // create the header at the top of the flight results,
    // and allow the user to return back to search if needed.
    createFlightHeader(inputOrigin, inputDestination, inputDate);
    $('#menu-back').unbind('click');
    $('#menu-back').on('click', function(){
      $('#results').addClass('hide');
      $('#menu').removeClass('hide');
    });

    // all the shenanigans used to determine whether or not the user
    // has picked the correct flight: the origin city, the desination city,
    // the date, and whether or not it's the cheapest/shorest flight.
    var correctOrigin = inputOrigin.indexOf(userOrigin) !== -1;
    var correctDestination = inputDestination.indexOf(userDestination) !== -1;
    var correctDate = inputDate === userDate;
    if(correctOrigin && correctDestination && correctDate){
      for(var i=0;i<flightResults.length; i++){
        createFlightElem(flightResults[i]);
        if(bookAction === 'shortest' &&  flightResults[i].duration < shortest)
          shortest = flightResults[i].duration;
        if(bookAction === 'cheapest' && flightResults[i].price < cheapestPrice)
          cheapestPrice = flightResults[i].price;
      }
    } else {
      // if any of the data is incorrect, generate dynamic/fake results for the user.
      var fakeFlights = generateFlights(inputOrigin, inputDestination, inputDate);
      for(var i=0;i<fakeFlights.length; i++){
        createFlightElem(fakeFlights[i]);
      }
    }

    $('.flight-price').on('click', function(){
      var $parent = $(this).parents('.flight');
      var price = parseInt($parent.find('.flight-price').attr('data-price'));
      var duration = parseInt($parent.find('.time-duration').attr('data-duration'));
      var r = (bookAction === 'shortest' && duration === shortest) || (bookAction === 'cheapest' && price === cheapestPrice) ? 1.0 : -1.0;
      core.endEpisode(r, r > 0);
    });

  });
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions:

Executing browser actions:

In order to accomplish the goal of booking the shortest one-way flight from Cedar Rapids, IA to Muscle Shoals, AL on 10/09/2016, we need to fill in the 'From:' and 'To:' textboxes with the respective locations and then select the 'Departure Date'. After that, we can click on the 'Search' button to proceed with the search.

Here are the actions to be taken:
1. fill('19', 'Cedar Rapids, IA')
2. fill('21', 'Muscle Shoals, AL')
3. click('25')  # Select the 'Departure Date'
4. click('27')  # Click on the 'Search' button)

Executing browser actions: fill('19', 'Cedar Rapids, IA')

In order to accomplish my goal, I need to fill in the 'From:' textbox with 'Cedar Rapids, IA', fill in the 'To:' textbox with 'Muscle Shoals, AL', and then fill in the 'Departure Date' textbox with '10/09/2016'. Finally, I need to click on the 'Search' button to find the shortest one-way flight.

##  Book Your One-Way Flight

Departure Date

Search

  * <::marker>

Cedar Rapids, IA (CID)

1 result is available, use up and down arrow keys to navigate.

Executing browser actions:

Executing browser actions: select_option('29', 'Muscle Shoals, AL')

In order to accomplish my goal, I need to fill in the destination information by selecting 'Muscle Shoals, AL' from the list.

Executing browser actions:

select_option('29', 'Muscle Shoals, AL'))

Executing browser actions: fill('25', '10/09/2016')

In order to accomplish the goal of booking the shortest one-way flight from Cedar Rapids, IA to Muscle Shoals, AL on 10/09/2016, the next action should be to fill in the departure date.

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("25")
  locator resolved to <input readonly value="" bid="25" type="text" id="datep…/>
elementHandle.fill("10/09/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

No observation

All done! What's next on the agenda?

No observation


Instruction: Buy the ticket with the shortest duration.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/buy-ticket.html

Duration:

24h 47m

Book for $838

Duration:

6h 43m

Book for $1421

Duration:

1h 17m

Book for $1536

Duration:

13h 2m

Book for $894

#area { height: 156px; position: relative;
  background-image: -webkit-linear-gradient(top, rgb(207, 223, 238) 0px, rgb(235, 240, 246) 100%); }

.flight { box-shadow: 0 1px 4px rgba(0,0,0,.3); background-color: #FFF;
  width: 140px; padding: 1px; border-radius: 3px; margin: 5px 6px; }
.label-container { display: inline-block; width: 29%; vertical-align: top; }
.label-container label { margin-left: 2px; color: #666; }
.details-container { display: inline-block; width: 69%; margin: 1px 0; }
.details-container div { margin-left: 2px; }

.book { text-align: center; }
.book button { width: 100px; border: 1px solid #B3B3B3; padding: 0px;
  border-radius: 3px; cursor: pointer; font-size: 11px;
  background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#fdd774),color-stop(1,#edb82e)); }
.error { border: 1px solid red !important; }

// NOTE: A lot of this code was reused from the book-flight task,
// so some variable names/functions might not make a ton of sense
// since they were repurposed for this task.
core.EPISODE_MAX_TIME = 10000;

var START_DATE = new Date(2017, 0, 1); // January 1, 2017
var END_DATE = new Date(2017, 5, 31); // June 30, 2016
var DAY_MILLISECONDS = 86400000;
var MAX_TRIPS = 4;
var DESIRED_TICKET = ['cheapest cost', 'shortest duration', 'longest duration', 'most expensive cost'];
var MAX_PRICE = 2000; // in USD.

var FLIGHT_TEMPLATE = `

Duration:

  <button class="buy-ticket">Book for </button>

`

var createFlightElem = function(result, index){
  var div = document.createElement('div');
  div.setAttribute('class', 'flight');
  div.setAttribute('data-result', index);
  div.innerHTML = FLIGHT_TEMPLATE;

  div.getElementsByClassName('time-duration')[0].innerHTML = result.userDuration;
  div.getElementsByClassName('time-duration')[0].setAttribute('data-duration', result.duration);
  div.getElementsByClassName('buy-ticket')[0].innerHTML += '$' + result.price;
  div.getElementsByClassName('buy-ticket')[0].setAttribute('data-price', result.price);

  $('#area').append(div);
}

var rewardEpisode = function(bookAction, $bought){
  switch(bookAction){
    case 'cheapest cost':
      return cheapestTrip($bought);
    case 'shortest duration':
      return shortestTrip($bought);
    case 'longest duration':
      return longestTrip($bought);
    case 'most expensive cost':
      return expensiveTrip($bought);
  }
}

var determinePrices = function(){
  var expensive = 0;
  var cheapest = MAX_PRICE;
  var tickets = $('.flight');

  for(var i=0;i<tickets.length;i++){
    var priceStr = $(tickets[i]).find('.buy-ticket').attr('data-price');
    var price = parseInt(priceStr, 10);
    cheapest = price < cheapest ? price : cheapest;
    expensive = price > expensive ? price : expensive;
  }
  return {cheapest: cheapest, expensive: expensive};
}

// reward based on whether or not bought ticket
// is the cheapest trip.
var cheapestTrip = function($bought){
  var boughtPriceStr = $bought.find('.buy-ticket').attr('data-price');
  var boughtPrice = parseInt(boughtPriceStr, 10);

  var prices = determinePrices();

  var reward = -1.0
  if(prices.cheapest === boughtPrice) reward = 1.0;
  else if(boughtPrice < prices.expensive) reward = -0.5;
  return reward;
}

// reward based on whether or not bought ticket
// is the most expensive trip.
var expensiveTrip = function($bought){
  var boughtPriceStr = $bought.find('.buy-ticket').attr('data-price');
  var boughtPrice = parseInt(boughtPriceStr, 10);
  var prices = determinePrices();
  var reward = -1.0

  if(prices.expensive === boughtPrice) reward = 1.0;
  else if(boughtPrice > prices.cheapest) reward = -0.5;
  return reward;
}

var determineDurations = function(){
  var longest = 0;
  var shortest = DAY_MILLISECONDS*2;
  var tickets = $('.flight');

  for(var i=0;i<tickets.length;i++){
    var durationStr = $(tickets[i]).find('.time-duration').attr('data-duration');
    var duration = parseInt(durationStr, 10);
    shortest = duration < shortest ? duration : shortest;
    longest = duration > longest ? duration : longest;
  }
  return {shortest: shortest, longest: longest};
}

// reward based on whether or not bought ticket
// is the shortest trip.
var shortestTrip = function($bought){
  var boughtDurationStr = $bought.find('.time-duration').attr('data-duration');
  var boughtDuration = parseInt(boughtDurationStr, 10);
  var durations = determineDurations();
  var reward = -1.0

  // give a shaped reward if they bought one of the medium duration flights.
  if(durations.shortest === boughtDuration) reward = 1.0;
  else if(boughtDuration < durations.longest) reward = -0.5;
  return reward;
}

// reward based on whether or not bought ticket
// is the longest trip.
var longestTrip = function($bought){
  var boughtDurationStr = $bought.find('.time-duration').attr('data-duration');
  var boughtDuration = parseInt(boughtDurationStr, 10);
  var durations = determineDurations();
  var reward = -1.0

  // give a shaped reward if they bought one of the medium duration flights.
  if(durations.longest === boughtDuration) reward = 1.0;
  else if(boughtDuration > durations.shortest) reward = -0.5;
  return reward;
}

var generateFlights = function(day){
  var results = [];
  var totalFlights = MAX_TRIPS; // hard-set this to 5 results.
  var flightStart = new Date(Date.parse(day));
  var flightStartMax = new Date(Date.parse(day) + DAY_MILLISECONDS);
  var flightEnd = new Date(Date.parse(day) + DAY_MILLISECONDS*1.5);
  for(var i=0;i<totalFlights;i++){
    var result = {}
    result.depart = {};
    result.arrive = {};

    var departDate = ui_utils.randomDate(flightStart, flightStartMax);
    var arriveDate = ui_utils.randomDate(departDate, flightEnd);

    result.depart.dateObj = departDate;
    result.depart.day = departDate.toDateString();
    result.depart.time = departDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    result.arrive.dateObj = arriveDate;
    result.arrive.day = arriveDate.toDateString();
    result.arrive.time = arriveDate.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3");

    var duration = (arriveDate - departDate)
    result.userDuration = parseInt((duration / (1000*60*60)) % 60) + 'h ' + parseInt((duration / (1000*60)) % 60) + 'm';
    result.duration = duration;
    result.price = core.randi(50, MAX_PRICE);

    results.push(result);
  }
  return results;
}

var genProblem = function(){
  // clear the UI.
  $('#area').empty();

  var expectedDate = ui_utils.randomDate(START_DATE, END_DATE);
  var userDate = ui_utils.toDateString(expectedDate);

  var bookAction = core.sample(DESIRED_TICKET);

  $('#query').html('Buy the ticket with the ' + bookAction + '.');

  var flightResults = generateFlights(userDate);

  var cheapestPrice = MAX_PRICE;
  var shortest = DAY_MILLISECONDS*2;

  for(var i=0;i<flightResults.length; i++){
    createFlightElem(flightResults[i]);
  }

  $('.buy-ticket').on('click', function(){
    var $bought = $(this).parents('.flight');
    var reward = rewardEpisode(bookAction, $bought);
    core.endEpisode(reward, reward > 0);
  });

}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click("37")

In order to accomplish the goal of buying the ticket with the shortest duration, the next action should be to click on the button associated with the flight duration of 1h 17m.

Executing browser actions:

Executing browser actions: click("33")

In order to accomplish my goal of buying the ticket with the shortest duration, I need to click on the button to book the flight with a duration of 1h 17m.

Executing browser actions:

Executing browser actions: click("33")

In order to accomplish my goal of buying the ticket with the shortest duration, I need to click on the button with bid 33.

Executing browser actions:

Executing browser actions: click("33")

Executing browser actions:

Executing browser actions: click("33")

In order to accomplish the goal of buying the ticket with the shortest duration, the next action should be to click on the button associated with the ticket duration of 1h 17m.

Agent reached maximum number of iterations


Instruction: Select 06/24/2016 as the date and hit submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/choose-date.html

Date:

Submit

div.ui-datepicker { font-size: 7px; }
.secondary-action { margin-left: 25px; }
p { margin: 0; padding: 0; }
input { width: 100px; display: inline-block; }

var START_DATE = new Date(2016, 0, 1); // January 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
core.EPISODE_MAX_TIME = 20000; // set episode interval to 20 seconds

var genProblem = function() {
  var d = ui_utils.randomDate(START_DATE, END_DATE);
  d3.select('#datepicker')[0][0].value = '';

  var q = ui_utils.toDateString(d);

  d3.select('#query').html('Select ' + q + ' as the date and hit submit.');

  d3.select('#subbtn').on('click', function(){
    var t = d3.select('#datepicker')[0][0].value;
    var r = t === q ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  })
}

window.onload = function() {
  $('#datepicker').datepicker({
    minDate: START_DATE,
    maxDate: END_DATE
  });

  core.startEpisode();
}

Executing browser actions: fill('17', '06/24/2016')

To accomplish the goal of selecting 06/24/2016 as the date and hitting submit, the following actions need to be taken:

1. Fill the textbox with the date '06/24/2016'
2. Click on the 'Submit' button

Date:

Submit

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("17")
  locator resolved to <input readonly value="" bid="17" type="text" id="datep…/>
elementHandle.fill("06/24/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

In order to accomplish my goal, I need to select the date '06/24/2016' from the textbox and then click on the 'Submit' button.

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

In order to accomplish my goal, I need to click on the "Submit" button.

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

In order to accomplish the goal of selecting 06/24/2016 as the date and hitting submit, the correct action would be to click the 'Submit' button again.

Date:

Submit

Executing browser actions:

Date:

Submit

Agent reached maximum number of iterations


Instruction: Select 12/20/2016 as the date and hit submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/choose-date-easy.html

Date:

Submit

var START_DATE = new Date(2016, 11, 1); // December 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
core.EPISODE_MAX_TIME = 20000; // set episode interval to 20 seconds

var genProblem = function() {
  var d = ui_utils.randomDate(START_DATE, END_DATE);
  d3.select('#datepicker')[0][0].value = '';

  var q = ui_utils.toDateString(d);

  d3.select('#query').html('Select ' + q + ' as the date and hit submit.');

  d3.select('#subbtn').on('click', function(){
    var t = d3.select('#datepicker')[0][0].value;
    var r = t === q ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  })
}

window.onload = function() {
  $('#datepicker').datepicker({
    minDate: START_DATE,
    maxDate: END_DATE
  });

  core.startEpisode();
}

Executing browser actions: fill('17', '12/20/2016')

In order to accomplish the goal of selecting 12/20/2016 as the date and hitting submit, the following actions need to be taken:

1. Fill the textbox with the date '12/20/2016':

Date:

Submit

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("17")
  locator resolved to <input readonly value="" bid="17" type="text" id="datep…/>
elementHandle.fill("12/20/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

Executing browser actions:

Date:

Submit

Executing browser actions: click("19")

In order to accomplish my goal, I need to click on the 'Submit' button.

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click("19")

In order to accomplish my goal, I need to click on the button with bid 19.

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click("19")

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click("19")

Date:

Submit


Instruction: Select 11/12/2016 as the date and hit submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/choose-date-medium.html

Date:

Submit

var START_DATE = new Date(2016, 10, 1); // November 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
core.EPISODE_MAX_TIME = 20000; // set episode interval to 20 seconds

var genProblem = function() {
  var d = ui_utils.randomDate(START_DATE, END_DATE);
  d3.select('#datepicker')[0][0].value = '';

  var q = ui_utils.toDateString(d);

  d3.select('#query').html('Select ' + q + ' as the date and hit submit.');

  d3.select('#subbtn').on('click', function(){
    var t = d3.select('#datepicker')[0][0].value;
    var r = t === q ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  })
}

window.onload = function() {
  $('#datepicker').datepicker({
    minDate: START_DATE,
    maxDate: END_DATE
  });

  core.startEpisode();
}

Executing browser actions:

Date:

Submit

Executing browser actions: fill('17', '11/12/2016')

In order to accomplish my goal, I need to fill the textbox with the date "11/12/2016" and then click on the "Submit" button.

Date:

Submit

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("17")
  locator resolved to <input readonly value="" bid="17" type="text" id="datep…/>
elementHandle.fill("11/12/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

Date:

Submit

Executing browser actions:

Date:

Submit

Executing browser actions: click('19')

In order to accomplish my goal, I need to click on the "Submit" button again.

Date:

Submit

Executing browser actions:

Date:

Submit

Agent reached maximum number of iterations


Instruction: Select 05/03/2016 as the date and hit submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/choose-date-nodelay.html

Date:

Submit

var START_DATE = new Date(2016, 0, 1); // January 1, 2015
var END_DATE = new Date(2016, 11, 31); // December 31, 2016
core.EPISODE_MAX_TIME = 20000; // set episode interval to 20 seconds

var genProblem = function() {
  var d = ui_utils.randomDate(START_DATE, END_DATE);
  d3.select('#datepicker')[0][0].value = '';
  $('#datepicker').datepicker('hide');

  var q = ui_utils.toDateString(d);

  d3.select('#query').html('Select ' + q + ' as the date and hit submit.');

  d3.select('#subbtn').on('click', function(){
    var t = d3.select('#datepicker')[0][0].value;
    var r = t === q ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  })
}

window.onload = function() {
  $('#datepicker').datepicker({
    minDate: START_DATE,
    maxDate: END_DATE,
    showAnim: '',
  });

  core.startEpisode();
}

To accomplish the goal of selecting 05/03/2016 as the date and hitting submit, the following actions can be taken:

1. Fill the textbox with the date '05/03/2016'
2. Click on the 'Submit' button

Date:

Submit

TimeoutError: Timeout 500ms exceeded.
=========================== logs ===========================
waiting for get_by_test_id("17")
  locator resolved to <input readonly value="" bid="17" type="text" id="datep…/>
elementHandle.fill("05/03/2016")
  waiting for element to be visible, enabled and editable
    element is not editable - waiting...
============================================================

Executing browser actions: fill('17', '05/03/2016')
click('19')

In order to accomplish the goal of selecting 05/03/2016 as the date and hitting submit, the correct action would be to fill the textbox with the date '05/03/2016' and then click the 'Submit' button.

Date:

Submit

In order to accomplish the goal, I need to select the date '05/03/2016' and then click on the submit button.

Therefore, the correct actions are:

Date:

Submit

Executing browser actions: select_option('17', '05/03/2016')

In order to accomplish the goal, I need to select the date '05/03/2016' and then click on the 'Submit' button.

Date:

Submit

Error: Error: Element is not a <select> element
=========================== logs ===========================
waiting for get_by_test_id("17")
  locator resolved to <input readonly value="" bid="17" type="text" id="datep…/>
  selecting specified option(s)
  Element is not a <select> element
============================================================

Executing browser actions:

Date:

Submit

In order to accomplish my goal, I need to select the date '05/03/2016' and hit submit. The correct action would be to select the option '05/03/2016' from the dropdown menu.

Date:

Submit

Too many errors encountered. Task failed.

No observation

All done! What's next on the agenda?

No observation


Instruction: Select Tuvalu from the list and click Submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/choose-list.html

Monaco  Greenland  Congo  Saint Martin  Tuvalu  Submit

select { margin-top: 5px; }
button { margin-top: 5px; }

var genProblem = function() {
  var div = d3.select('#area');
  div.html('');

  var ITEMS = core.randf(0,1) < 0.5 ? ui_utils.PEOPLE_NAMES : ui_utils.COUNTRIES;
  ITEMS = ITEMS.slice(); // create a copy
  core.shuffle(ITEMS);

  var sel = div.append('select').attr('id', 'options').attr('style', 'width:150px;');
  var n = core.randi(3, 10);
  for(var i=0;i<n;i++) {
    sel.append('option').html(ITEMS[i]);
  }

  var ix = core.randi(0, n); // ground truth index
  var gt_txt = ITEMS[ix];
  d3.select('#query').html('Select ' + gt_txt + ' from the list and click Submit.');

  var btn = div.append('button').html('Submit');
  btn.attr('class', 'secondary-action');
  btn.on('click', function(){
    var sel = document.getElementById('options');
    var sel_txt = sel.options[sel.selectedIndex].innerHTML;
    var r = gt_txt === sel_txt ? 1.0 : -1.0;
    core.endEpisode(r, r>0);
  });
}

var countries = [];

window.onload = function() {
  d3.selectAll('option').each(function(d){
    countries.push(this.innerHTML);
  });

  core.startEpisode();
}

Executing browser actions: python
select_option('13', 'Tuvalu')
click('19')

In order to accomplish the goal of selecting Tuvalu from the list and clicking Submit, the following actions need to be taken:

1. Select Tuvalu from the combobox.
2. Click the Submit button.

Executing browser actions:

Executing browser actions: click('19')

In order to accomplish the goal of selecting Tuvalu from the list and clicking Submit, the correct action is to click the Submit button after selecting Tuvalu from the combobox.

Therefore, the correct action is:

Executing browser actions:

In order to accomplish the goal, I need to select Tuvalu from the list and then click Submit.

Executing browser actions:

In order to accomplish my goal, I need to select Tuvalu from the list and then click Submit.

Executing browser actions:

Executing browser actions: select_option('13', 'Tuvalu')
click('19')

Agent reached maximum number of iterations


Instruction: Find and click on the center of the circle, then press submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/circle-center.html

Submit

#area { position: relative; height: 160px; width: 160px; }
#area svg { width: 150px; height: 130px; }
#subbtn { left: 30px; bottom: 5px; position: absolute; }

var RADIUS_PADDING = 3; // 3px for circle radius
var QUERY_PADDING = 50; // 50px padding from #query

function graphClicked(event) {
  var x = event.pageX;
  var y = event.pageY;

  var divWidth = document.getElementById('svg-grid').clientWidth;
  var divHeight = document.getElementById('svg-grid').clientHeight;
  var svg = d3.select('svg');

  d3.selectAll('.blue').remove();
  shapes.drawCircles([{ class: 'blue', id: 'blue-circle', cx: x, cy: (y-QUERY_PADDING),
    r: 3.5, fill: 'blue' }], svg);
}

var drawAnswer = function(answer){
  var svg = d3.select('svg');

  shapes.drawCircles([{ class: 'green', id: 'green-circle', cx: answer.cx,
    cy: answer.cy, r: 3.5, fill: 'green' }], svg);
}

var computeDistances = function(generatedCircle){
  drawAnswer(generatedCircle);
  // error handle for submitting without any shapes
  if(d3.select('#blue-circle')[0][0] === null) {
    core.endEpisode(-1, false);
    return;
  }

  var distance = computeShortestPath(generatedCircle);
  var maxDistance = generatedCircle.r; // max acceptable distance of 30px.
  var score = (maxDistance - distance)/maxDistance;

  // create a scalar if score is within max distance.
  // otherwise reward a negative score.
  if(distance < maxDistance) core.endEpisode(score, true);
  else core.endEpisode(-1, false);
}

var computeShortestPath = function(generatedCircle){
  var userCircle = d3.select('#blue-circle')[0][0].getBBox();

  var xDiff = Math.pow(userCircle.x - (generatedCircle.cx - RADIUS_PADDING), 2);
  var yDiff = Math.pow(userCircle.y - (generatedCircle.cy - RADIUS_PADDING), 2);

  var path = Math.sqrt(xDiff + yDiff);
  return path;
}

var genProblem = function() {
  var svg = d3.select('svg');
  svg.selectAll('*').remove();

  var circleRadius = core.randi(25,40);
  var generatedCircle = { cx: core.randi(5+circleRadius,130-circleRadius), cy: core.randi(5+circleRadius,130 - circleRadius),
    r: circleRadius, stroke: 'black', fill: 'white', class: 'black-circle' };
  shapes.drawCircles([ generatedCircle ], svg);

  svg.on('click', function(){ graphClicked(event); });

  d3.select('#subbtn').on('click', function(){
    computeDistances(generatedCircle);
  });
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click("13")

In order to accomplish my goal, I need to click on the center of the circle.

Submit

Executing browser actions:

Submit

Executing browser actions: click("13")

Submit

Executing browser actions:

Submit

Executing browser actions: click("13")

Submit

Executing browser actions:

Submit

Executing browser actions: click("13")

Submit

Executing browser actions:

click("13")

# Explanation
To accomplish the goal of clicking on the center of the circle, the next action should be to click on the image with bid "13".)

Submit

Executing browser actions: click("13")

Submit

Agent reached maximum number of iterations


Instruction: Click on the "Submit" button.

Click on the "Submit" button.

Click on the "Submit" button.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-button.html

accumsan nisi, pulvinar

cancel  okay  Submit  submit

amet arcu nulla

var buttons = ['submit', 'okay', 'ok', 'yes', 'no', 'cancel', 'next', 'previous'];

var genProblem = function() {
  // generate the task
  var div = d3.select('#area');
  div.html(''); // clear previous problem, if any

  var num = 6;
  var elements = [];
  for(var i=0;i<num;i++) {
    var u = core.randf(0,1);
    var must_make_button = (i === num-1) && elements.length === 0;

    if(u < 0.33 && !must_make_button) {
      var txt = ''; for(var q=0;q<3;q++) { txt += ' ' + core.sample(ui_utils.lorem_words); }
      div.append('div').html(txt);
    } else if(u < 0.66 && !must_make_button) {

      if(core.randf(0,1) < 0.5) {
        var txt = ''; for(var q=0;q<3;q++) { txt += ' ' + core.sample(ui_utils.lorem_words); }
        txt += ': ';
        div.append('span').html(txt);
      }

      var w = core.randi(40, 150);
      div.append('input').attr('type', 'text').attr('style', 'width:' + w + 'px;');
      div.append('br');
    } else {
      var btn_text = core.sample(buttons);
      if(core.randf(0,1) < 0.5) btn_text = ui_utils.txtCapitalize(btn_text);
      var btn = div.append('button').html(btn_text);
      if(core.randf(0,1) < 0.5) div.append('br');
      elements.push(btn);
    }

  }

  var correct_text = core.sample(elements).html();
  for(var i = 0, len = elements.length; i < len; i++) {
    var e = elements[i];
    if(e.html() === correct_text) {
      e.on('click', function(){ core.endEpisode(1.0, true); })
    } else {
      e.on('click', function(){ core.endEpisode(-1.0); })
    }
  }

  // generate query text in the UI
  d3.select('#query').html('Click on the "' + correct_text + '" button.');
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions:

Executing browser actions: click("15")

In order to accomplish my goal I need to click on the "Submit" button.

Executing browser actions:

Executing browser actions: click("15")

Executing browser actions:

Executing browser actions: click("15")

Executing browser actions:

Executing browser actions: click("15")

Executing browser actions:


Instruction: Click button ONE, then click button TWO.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-button-sequence.html

ONE  TWO

#subbtn { width: 40px; height: 40px; }
#subbtn2 { width: 40px; height: 40px; }

var EXPECTED_SEQUENCE = ['subbtn', 'subbtn2'];
var buttonsPushed = [];

var buttonClicked = function(){
  var id = this.getAttribute('id');
  buttonsPushed.push(id);
  if(buttonsPushed.length == 2){
    var correctPushed = buttonsPushed.every(function(v,i){return v==EXPECTED_SEQUENCE[i];});
    var r = correctPushed ? 1.0 : -1.0;
    core.endEpisode(r, r>0);
  }
}

var genProblem = function() {
  buttonsPushed = [];
  var L = core.randi(0, 118); var U = core.randi(0, 118) + 50;
  var btn = d3.select('#subbtn');
  btn.attr('style', 'position:absolute; left:'+L+'px; top:'+U+'px');
  btn.on('click', buttonClicked);

  var L = core.randi(0, 118); var U = core.randi(0, 118) + 50;
  var btn = d3.select('#subbtn2');
  btn.attr('style', 'position:absolute; left:'+L+'px; top:'+U+'px');
  btn.on('click', buttonClicked);
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions:

ONE  TWO

Executing browser actions: click("12")
click("13")

In order to accomplish my goal I need to click on button ONE first and then click on button TWO.

ONE  TWO

Executing browser actions:

ONE  TWO

Executing browser actions: click("13")

In order to accomplish my goal I need to click on the button with bid 13

ONE  TWO

Executing browser actions:

ONE  TWO

Executing browser actions: click("12")

In order to accomplish my goal I need to click on the button with bid 12

ONE  TWO

Executing browser actions:

ONE  TWO

Executing browser actions: click("12")

In order to accomplish my goal, I need to click on button ONE first and then click on button TWO.

ONE  TWO

Executing browser actions:

ONE  TWO

Agent reached maximum number of iterations


Instruction: Select MA, d5PFpXf and click Submit.

Select MA, d5PFpXf and click Submit.

Select MA, d5PFpXf and click Submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-checkboxes.html

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

var createCheckboxes = function(div){
  var checkboxData = { toclick: {}, clickNames: [] };

  checkboxData.elems = core.randi(2, 7);
  for(var i=0;i<checkboxData.elems;i++) {
    var chname = ui_utils.generateString(2,8);
    var label = div.append('label')
    label.append('input').attr('type', 'checkbox').attr('id', 'ch'+i);
    label[0][0].innerHTML += chname;
    div.append('br');

    checkboxData.toclick[i] = false;
    if(core.randf(0,1) < 0.5) {
      checkboxData.toclick[i] = true;
      checkboxData.clickNames.push(chname);
    }
  }

  return checkboxData;
}

var genProblem = function() {
  var div = d3.select('#boxes');
  div.html('');

  var checkboxData = createCheckboxes(div);

  var qstr = checkboxData.clickNames.join(', ');
  if(qstr.length === 0) { qstr = 'nothing'; }
  d3.select('#query').html('Select ' + qstr + ' and click Submit.');

  d3.select('#subbtn').on('click', function(){
    var r = 0;
    for(var i=0;i<checkboxData.elems;i++) {
      var is_checked = d3.select('#ch'+i)[0][0].checked;
      r += is_checked === checkboxData.toclick[i] ? 1.0 : -1.0;
    }
    core.endEpisode(r / checkboxData.elems, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

fgNz

labelledby

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Executing browser actions: click('MA')
click('d5PFpXf')
click('33')

In order to accomplish my goal I need to select MA and d5PFpXf checkboxes and then click on the Submit button.

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

ValueError: Could not find element with bid "MA"

Executing browser actions: click('MA')

In order to accomplish my goal I need to click on the 'MA' checkbox and then click on the 'd5PFpXf' checkbox, followed by clicking on the 'Submit' button.

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Executing browser actions: select_option('24', 'MA')

In order to accomplish the goal, I need to select 'MA' and 'd5PFpXf' checkboxes and then click on the 'Submit' button.

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Error: Error: Element is not a <select> element
=========================== logs ===========================
waiting for get_by_test_id("24")
  locator resolved to <input id="ch2" bid="24" value="on" type="checkbox" bro…/>
  selecting specified option(s)
  Element is not a <select> element
============================================================

Executing browser actions:

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Executing browser actions: click('MA')

In order to accomplish the goal, I need to click on the checkboxes with bids 'MA' and 'd5PFpXf' and then click on the button with bid '33'.

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Executing browser actions:

fgNz
TqhMB
MA
d5PFpXf
cU

Submit

fgNz

fgNz

TqhMB

TqhMB

MA

MA

cU

cU

Too many errors encountered. Task failed.

No observation

All done! What's next on the agenda?

No observation


Instruction: Select FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, P8rP and click Submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-checkboxes-large.html

digblgb
IX
FJBuyjk
iwXD
P8rP
1wIZRZc

sC
j5MJVf
dAJm6M
McOe
Kq
TgnN50t

Submit

input { width: 20px; }
#boxes-left, #boxes-right { float: left; }
br { clear: both; }

core.EPISODE_MAX_TIME = 20000; // 20 seconds

var createCheckboxes = function(left, right) {
  var checkboxData = { toclick: {}, clickNames: [] };

  checkboxData.numToClick = core.randi(5, 13);
  checkboxData.elems = core.randi(Math.max(7, checkboxData.numToClick), 13);
  checkboxData.names = [];
  for(var i=0;i<checkboxData.elems;i++) {
    var div = (i < (checkboxData.elems) / 2) ? left : right;
    var chname = ui_utils.generateString(2,8);
    var label = div.append('label')
    label.append('input').attr('type', 'checkbox').attr('id', 'ch'+i);
    label[0][0].innerHTML += chname;
    div.append('br');
    checkboxData.names.push([i, chname]);
  }
  core.shuffle(checkboxData.names);
  for(var j=0;j<checkboxData.elems;j++) {
    if (j < checkboxData.numToClick) {
      checkboxData.toclick[checkboxData.names[j][0]] = true;
      checkboxData.clickNames.push(checkboxData.names[j][1]);
    } else {
      checkboxData.toclick[checkboxData.names[j][0]] = false;
    }
  }

  return checkboxData;
}

var genProblem = function() {
  var left = d3.select('#boxes-left').html('');
  var right = d3.select('#boxes-right').html('');

  var checkboxData = createCheckboxes(left, right);

  var qstr = checkboxData.clickNames.join(', ');
  if(qstr.length === 0) { qstr = 'nothing'; }
  d3.select('#query').html('Select ' + qstr + ' and click Submit.');

  d3.select('#subbtn').on('click', function(){
    var r = 0;
    for(var i=0;i<checkboxData.elems;i++) {
      var is_checked = d3.select('#ch'+i)[0][0].checked;
      r += is_checked === checkboxData.toclick[i] ? 1.0 : -1.0;
    }
    core.endEpisode(r / checkboxData.elems, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

Executing browser actions: select_option('24', True)
select_option('37', True)
select_option('21', True)
select_option('46', True)
select_option('52', True)
select_option('43', True)
select_option('33', True)
select_option('40', True)
select_option('30', True)
click('55')

In order to accomplish my goal I need to select FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, P8rP and click Submit.

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

Error: options[0].valueOrLabel: expected string, got boolean

Executing browser actions:

select_option('24', True)
select_option('37', True)
select_option('21', True)
select_option('46', True)
select_option('52', True)
select_option('43', True)
select_option('33', True)
select_option('40', True)
select_option('30', True)
click('55')
select_option('48', True))

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

In order to accomplish my goal, I need to select FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, P8rP and click Submit.

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

Executing browser actions: select_option('24')
select_option('37')
select_option('21')
select_option('46')
select_option('52')
select_option('43')
select_option('33')
select_option('40')
select_option('30')
click('55')

To accomplish the goal, the next action should be to select the checkboxes for FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, and P8rP, and then click Submit.

Therefore, the correct action to take next is:

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

TypeError: select_option() missing 1 required positional argument: 'options'

In order to accomplish the goal of selecting FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, P8rP and click Submit, the next action should be:

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

In order to accomplish the goal, the next action should be to select the checkboxes for FJBuyjk, sC, IX, McOe, TgnN50t, dAJm6M, 1wIZRZc, j5MJVf, P8rP and then click Submit.

digblgb

digblgb

IX

IX

FJBuyjk

FJBuyjk

iwXD

iwXD

sC

sC

McOe

McOe

Kq

Kq

Too many errors encountered. Task failed.

No observation

All done! What's next on the agenda?

No observation


Instruction: Select words similar to miserable, actual and click Submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-checkboxes-soft.html

conceal
incorrect
sorrowful
scarlet
genuine
television

Submit

var SYNONYMS = [
  ['big', 'large', 'huge', 'enormous', 'gigantic'],
  ['small', 'tiny', 'little', 'mini', 'petite'],
  ['red', 'scarlet', 'crimson', 'vermillion'],
  ['happy', 'cheerful', 'joyful', 'gleeful', 'delighted'],
  ['sad', 'unhappy', 'sorrowful', 'miserable', 'tragic'],
  ['angry', 'mad', 'furious', 'irritated'],
  ['evil', 'wicked', 'immoral', 'sinful', 'corrupt', 'depraved'],
  ['wrong', 'incorrect', 'mistaken', 'erroneous'],
  ['real', 'genuine', 'actual'],
  ['strange', 'odd', 'peculiar', 'unusual', 'weird'],
  ['stop', 'cease', 'halt', 'end', 'finish'],
  ['scared', 'terrified', 'panicked', 'fearful', 'frightened', 'afraid'],
  ['quiet', 'calm', 'peaceful', 'serene', 'mild'],
  ['old', 'aged', 'archaic'],
  ['love', 'like', 'adore', 'favor'],
  ['kill', 'murder', 'assassinate'],
  ['keep', 'retain', 'preserve', 'sustain', 'maintain'],
  ['hide', 'conceal', 'camouflage'],
  ['hate', 'despise', 'loathe', 'detest', 'dislike'],
  ['funny', 'humorous', 'amusing', 'comical', 'laughable'],
  ['fat', 'fleshy', 'plump', 'chubby'],
  ['stupid', 'dumb', 'dull', 'unwise'],
  ['delicious', 'savory', 'delectable', 'appetizing'],
  ['cut', 'slice', 'carve', 'chop'],
  ['brave', 'courageous', 'fearless'],
  ['begin', 'start', 'initiate', 'launch'],
  ['answer', 'reply', 'response'],
  ['television', 'televisions', 'TV', 'TVs'],
  ['house', 'home', 'houses', 'homes'],
  ['fire', 'flame', 'fires', 'flames'],
  ['pig', 'pork', 'swine', 'pig'],
  ['rabbit', 'rabbits', 'bunny', 'bunnies'],
  ['car', 'cars', 'automobile', 'automobiles', 'vehicle', 'vehicles'],
  ['water'],
];

var createCheckboxes = function(div){
  var checkboxData = { toclick: {}, clickNames: [] };

  checkboxData.elems = core.randi(2, 7);
  var wordList = SYNONYMS.slice();
  core.shuffle(wordList);
  checkboxData.numToClick = core.randi(1, 6);
  checkboxData.elems = core.randi(Math.max(3, checkboxData.numToClick + 1), 7);
  checkboxData.names = [];
  for(var i=0;i<checkboxData.elems;i++) {
    var chname = core.sample(wordList[i]);
    var label = div.append('label')
    label.append('input').attr('type', 'checkbox').attr('id', 'ch'+i);
    label[0][0].innerHTML += core.sample(wordList[i]);
    div.append('br');
    checkboxData.names.push([i, chname]);
  }
  core.shuffle(checkboxData.names);
  for(var j=0;j<checkboxData.elems;j++) {
    if (j < checkboxData.numToClick) {
      checkboxData.toclick[checkboxData.names[j][0]] = true;
      checkboxData.clickNames.push(checkboxData.names[j][1]);
    } else {
      checkboxData.toclick[checkboxData.names[j][0]] = false;
    }
  }

  return checkboxData;
}

var genProblem = function() {
  var div = d3.select('#boxes');
  div.html('');

  var checkboxData = createCheckboxes(div);

  var qstr = checkboxData.clickNames.join(', ');
  if(qstr.length === 0) { qstr = 'nothing'; }
  d3.select('#query').html('Select words similar to ' + qstr + ' and click Submit.');

  d3.select('#subbtn').on('click', function(){
    var r = 0;
    for(var i=0;i<checkboxData.elems;i++) {
      var is_checked = d3.select('#ch'+i)[0][0].checked;
      r += is_checked === checkboxData.toclick[i] ? 1.0 : -1.0;
    }
    core.endEpisode(r / checkboxData.elems, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions:

select_option('24', 'miserable')
select_option('30', 'actual')
click('36'))

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions: click('24')
click('30')
click('36')

In order to accomplish the goal of selecting words similar to miserable, actual, and clicking Submit, the next action should be to select the checkboxes for 'sorrowful' and 'genuine'.

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

In order to accomplish the goal of selecting words similar to miserable, actual and click Submit, the next action should be to click on the checkbox for 'sorrowful' and 'genuine'.

Therefore, the correct action would be:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions: click('24')

In order to accomplish the goal of selecting words similar to miserable, actual and click Submit, the next action should be to click on the checkbox for the word "sorrowful".

Therefore, the next action should be:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions: click('24')

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Executing browser actions:

conceal

conceal

incorrect

incorrect

sorrowful

sorrowful

scarlet

scarlet

genuine

genuine

television

television

Agent reached maximum number of iterations


Instruction: Select pI2, UCCs and click Submit.

Select pI2, UCCs and click Submit.

Select pI2, UCCs and click Submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-checkboxes-transfer.html

gD3
pY
UCCs
pI2
YzWaY

Submit

var createCheckboxes = function(div){
  var checkboxData = { toclick: {}, clickNames: [] };

  if (WOB_DATA_MODE == 'test')
    checkboxData.numToClick = core.randi(4, 7);
  else
    checkboxData.numToClick = core.randi(0, 4);
  checkboxData.elems = core.randi(Math.max(3, checkboxData.numToClick), 7);
  checkboxData.names = [];
  for(var i=0;i<checkboxData.elems;i++) {
    var chname = ui_utils.generateString(2,8);
    var label = div.append('label')
    label.append('input').attr('type', 'checkbox').attr('id', 'ch'+i);
    label[0][0].innerHTML += chname;
    div.append('br');
    checkboxData.names.push([i, chname]);
  }
  core.shuffle(checkboxData.names);
  for(var j=0;j<checkboxData.elems;j++) {
    if (j < checkboxData.numToClick) {
      checkboxData.toclick[checkboxData.names[j][0]] = true;
      checkboxData.clickNames.push(checkboxData.names[j][1]);
    } else {
      checkboxData.toclick[checkboxData.names[j][0]] = false;
    }
  }

  return checkboxData;
}

var genProblem = function() {
  var div = d3.select('#boxes');
  div.html('');

  var checkboxData = createCheckboxes(div);

  var qstr = checkboxData.clickNames.join(', ');
  if(qstr.length === 0) { qstr = 'nothing'; }
  d3.select('#query').html('Select ' + qstr + ' and click Submit.');

  d3.select('#subbtn').on('click', function(){
    var r = 0;
    for(var i=0;i<checkboxData.elems;i++) {
      var is_checked = d3.select('#ch'+i)[0][0].checked;
      r += is_checked === checkboxData.toclick[i] ? 1.0 : -1.0;
    }
    core.endEpisode(r / checkboxData.elems, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

pY

pY

UCCs

UCCs

YzWaY

YzWaY

Executing browser actions: click('pI2')
click('UCCs')
click('Submit')

In order to accomplish the goal, we need to select the checkboxes for 'pI2' and 'UCCs', and then click on the 'Submit' button.

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

ValueError: Could not find element with bid "pI2"

Executing browser actions:

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

Executing browser actions: click('pI2')

In order to accomplish my goal I need to select pI2, UCCs and click Submit.

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

Executing browser actions:

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

Executing browser actions:

gD3
pY
UCCs
pI2
YzWaY

Submit

pY

pY

UCCs

UCCs

YzWaY

YzWaY

No observation

All done! What's next on the agenda?

No observation


Instruction: Expand the section below and click submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-collapsible.html

###  Section #48

Porttitor leo nibh tellus pellentesque volutpat ac. Ornare vel tincidunt volutpat scelerisque nisl. Euismod nibh pretium consequat. Aliquet. Mauris viverra.

Submit

#area h3 { background: #007fff; border: 1px solid #003eff; border-radius: 3px; color: #ffffff; font-weight: normal; margin: 2px; padding: 1px; }
#area div { margin: 2px; }
.alink { text-decoration: underline; color: blue; cursor: pointer; }
.ui-accordion-content { border-width: 0 1px 1px 1px; border-style: solid; padding: 1px; }

var createCollapsible = function(div){
  var randomNum = core.randi(1,51);
  var header = '
Section #' + randomNum + '
';
  var html = '
' + ui_utils.generateWords(20) + '
';
  // place in DOM
  div.append(header + html + '

<button id="subbtn" class="secondary-action">Submit</button>
');
}

var genProblem = function() {
  // generate the task
  var div = $('#area');
  if(div.html().length > 0){ $('#area').accordion('destroy'); }
  div.empty(); // clear previous problem, if any
  $.resetUniqueId();

  createCollapsible(div);

  // generate query text in the UI
  d3.select('#query').html('Expand the section below and click submit.');
  $('#area').accordion({active: false, collapsible: true});

  d3.select('#subbtn').on('click', function(){
    var t = $('.ui-accordion-content:visible').length;
    var r = t === 1 ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

ui-accordion-header ui-corner-top ui-accordion-header-collapsed ui-corner-all ui-state-default ui-accordion-icons

Executing browser actions: click("16")

In order to accomplish the goal of expanding the section, the next action should be to click on the 'Section #48' tab to expand it.

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-hover ui-state-focus ui-accordion-header-active ui-state-active

ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content ui-accordion-content-active

Section #48

Section #48

Executing browser actions:

Section #48

Section #48

Executing browser actions: click("22")

In order to accomplish my goal, I need to click on the "Submit" button.

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-focus ui-accordion-header-active ui-state-active

Executing browser actions:

Executing browser actions: click("22")

In order to accomplish my goal, I need to submit the form by clicking on the "Submit" button.

Executing browser actions:

Executing browser actions: click("22")

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-focus ui-state-hover ui-accordion-header-active ui-state-active

Executing browser actions:

Executing browser actions: click("22")

Agent reached maximum number of iterations


Instruction: Expand the sections below, to find and click on the link "Maecenas.".

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-collapsible-2.html

###  Section #1

Nunc tincidunt. Congue ultricies vel maecenas. Vel.  Molestie.  Egestas  ornare  sit sit nullam scelerisque. Risus non  id  et elementum in.

###  Section #2

Vitae arcu ullamcorper id bibendum  ut  semper non  leo  suscipit. Mi. Gravida. Sed. Massa.  Maecenas.  Duis dictum  felis,  leo. Scelerisque.

###  Section #3

Neque luctus  integer  venenatis at ut volutpat fermentum,  lorem  vulputate est eros, dapibus  nibh.  Nullam consequat, nunc. Ultrices integer  nec.

var createLinks = function(div){
  for(var i=0;i<3;i++){
    var header = '
 Section #' + (i+1) + '
';
    var txt =  ui_utils.generateWords(20).split(/\s/g);
    for(var j=0;j<txt.length; j++){
      if(Math.random() < 0.2) txt[j] = '' + txt[j] + '';
    }
    html = '
' + txt.join(' '); + '
';

    // place in DOM
    div.append(header + html);
  }
}

var bindClickEvents = function(){
  // now hook handlers to all generated links
  var elements = document.getElementsByClassName('alink');
  var correct_ix = core.randi(0, elements.length);
  var correct_text = elements[correct_ix].innerHTML;

  for(var i = 0, len = elements.length; i < len; i++) {
    var e = elements[i];
    if(e.innerHTML === correct_text) {
      d3.select(e).on('click', function(){ core.endEpisode(1.0, true); })
    } else {
      d3.select(e).on('click', function(){ core.endEpisode(-1.0); })
    }
  }
  return elements[correct_ix].innerHTML;
}

var genProblem = function() {
  // generate the task
  var div = $('#area');
  if(div.html().length > 0){ $('#area').accordion('destroy'); }
  div.empty(); // clear previous problem, if any
  $.resetUniqueId();

  createLinks(div);
  var any = core.getOpt(core.QueryString, 'any', false); // click any link?
  var correctText = bindClickEvents();

  // generate query text in the UI
  d3.select('#query').html('Expand the sections below, to find and click on the link "' + correctText + '".');
  $('#area').accordion({active: false, collapsible: true});
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click('16')

In order to accomplish my goal, I need to click on the link "Maecenas" which is likely located within one of the sections. To achieve this, I should first expand the sections to reveal the link. Let's start by expanding 'Section #1', 'Section #2', and 'Section #3'.

Section #1

Section #1

Executing browser actions:

Section #1

Section #1

Executing browser actions: click('18')

In order to accomplish my goal, I need to click on the link "Maecenas" within the current tab panel.

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-active ui-state-active

Section #1

Section #1

Executing browser actions:

Section #1

Section #1

Executing browser actions: click('22')

In order to accomplish the goal of expanding the sections to find and click on the link "Maecenas," the next action should be to click on the tab with bid '22' which corresponds to 'Section #2'.

Section #2

Section #2

Executing browser actions: click('24')

In order to accomplish my goal I need to click on the link "Maecenas."

Section #2

Section #2

Executing browser actions: click('29')

To accomplish the goal, you should click on the link "Maecenas."

Section #3

Section #3

Executing browser actions:

Section #3

Section #3

Executing browser actions: scroll(0, 200)

In order to accomplish my goal I need to click on the link "Maecenas" which is likely to be found in the content of the page. Let's scroll down to explore the content further.

Section #3

Section #3

Agent reached maximum number of iterations


Instruction: Expand the sections below, to find and click on the link "egestas".

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-collapsible-2-nodelay.html

###  Section #1

Risus ultrices sed.  Pharetra  orci. Turpis rhoncus semper  vestibulum,  velit,.  A  iaculis  dignissim pretium,. Lectus dignissim  interdum  feugiat  elementum  cum.

###  Section #2

Dis sed cras vivamus malesuada nibh nam  dui  sem  ut nunc, faucibus malesuada feugiat bibendum quam  molestie  nunc. Elementum,  magna.

###  Section #3

Morbi  nisl interdum a in nunc,  egestas  sagittis non, in vulputate eget. Fringilla lacus,. Feugiat. Sodales mauris in ante sed.

var createLinks = function(div){
  for(var i=0;i<3;i++){
    var header = '
 Section #' + (i+1) + '
';
    var txt =  ui_utils.generateWords(20).split(/\s/g);
    for(var j=0;j<txt.length; j++){
      if(Math.random() < 0.2) txt[j] = '' + txt[j] + '';
    }
    html = '
' + txt.join(' '); + '
';

    // place in DOM
    div.append(header + html);
  }
}

var bindClickEvents = function(){
  // now hook handlers to all generated links
  var elements = document.getElementsByClassName('alink');
  var correct_ix = core.randi(0, elements.length);
  var correct_text = elements[correct_ix].innerHTML;

  for(var i = 0, len = elements.length; i < len; i++) {
    var e = elements[i];
    if(e.innerHTML === correct_text) {
      d3.select(e).on('click', function(){ core.endEpisode(1.0, true); })
    } else {
      d3.select(e).on('click', function(){ core.endEpisode(-1.0); })
    }
  }
  return elements[correct_ix].innerHTML;
}

var genProblem = function() {
  // generate the task
  var div = $('#area');
  if(div.html().length > 0){ $('#area').accordion('destroy'); }
  div.empty(); // clear previous problem, if any
  $.resetUniqueId();

  createLinks(div);
  var any = core.getOpt(core.QueryString, 'any', false); // click any link?
  var correctText = bindClickEvents();

  // generate query text in the UI
  d3.select('#query').html('Expand the sections below, to find and click on the link "' + correctText + '".');
  $('#area').accordion({active: false, collapsible: true, animate: false});
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click('16')

In order to accomplish the goal of expanding the sections to find and click on the link "egestas", you should first expand the sections to reveal the content. Since the current focus is on the 'Click Collapsible Task', you can start by expanding the sections one by one until you find the "egestas" link.

Here is the action to expand the first section 'Section #1':

#area h3 { background: #007fff; border: 1px solid #003eff; border-radius: 3px; color: #ffffff; font-weight: normal; margin: 2px; padding: 1px; }
#area div { margin: 2px; }
.alink { text-decoration: underline; color: blue; cursor: pointer; }
.ui-accordion-content { border-width: 0 1px 1px 1px; border-style: solid; padding: 1px; }

ui-accordion-header ui-corner-top ui-accordion-header-collapsed ui-corner-all ui-state-default ui-accordion-icons

ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content

Section #1

Section #1

Executing browser actions:

Section #1

Section #1

Executing browser actions: click('egestas')

In order to accomplish my goal, I need to click on the link "egestas" within the Section #1 tabpanel.

Section #1

Section #1

ValueError: Could not find element with bid "egestas"

Executing browser actions:

Section #1

Section #1

Executing browser actions: click('25')

In order to accomplish the goal of expanding the sections to find and click on the link "egestas", the next valid action would be to click on the tab associated with "Section #2".

Section #2

Section #2

Executing browser actions:

Section #2

Section #2

In order to accomplish the goal of clicking on the link "egestas", the next action should be to click on the link with the text "egestas" within the current tabpanel.

Section #2

Section #2

Executing browser actions: click('27')

In order to accomplish the goal of clicking on the link "egestas", the next action should be to click on the link with bid '27'.

Section #2

Section #2

Executing browser actions:

Section #2

Section #2

Agent reached maximum number of iterations


Instruction: Expand the section below and click submit.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-collapsible-nodelay.html

###  Section #23

Bibendum vitae vitae mauris velit diam. Elementum sollicitudin phasellus ut nunc. Aliquam morbi semper ut fringilla interdum viverra fermentum. Pretium.

Submit

var createCollapsible = function(div){
  var randomNum = core.randi(1,51);
  var header = '
Section #' + randomNum + '
';
  var html = '
' + ui_utils.generateWords(20) + '
';
  // place in DOM
  div.append(header + html + '

<button id="subbtn" class="secondary-action">Submit</button>
');
}

var genProblem = function() {
  // generate the task
  var div = $('#area');
  if(div.html().length > 0){ $('#area').accordion('destroy'); }
  div.empty(); // clear previous problem, if any
  $.resetUniqueId();

  createCollapsible(div);

  // generate query text in the UI
  d3.select('#query').html('Expand the section below and click submit.');
  $('#area').accordion({active: false, collapsible: true, animate: false});

  d3.select('#subbtn').on('click', function(){
    var t = $('.ui-accordion-content:visible').length;
    var r = t === 1 ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  });
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions: click("19")

In order to accomplish the goal of expanding the section "Submit", the next action should be to click on the tab "Submit".

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-hover ui-state-focus ui-accordion-header-active ui-state-active

Executing browser actions: click("22")

Executing browser actions: click("16")

In order to accomplish my goal, I need to click on the tab "Section #23" to expand it and view its content.

ui-accordion-content ui-corner-bottom ui-helper-reset ui-widget-content ui-accordion-content-active

Section #23

Section #23

Executing browser actions:

Section #23

Section #23

Executing browser actions: click("22")

In order to accomplish my goal, I need to click on the button "Submit" to complete the task.

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-accordion-header-collapsed ui-corner-all

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-focus ui-accordion-header-active ui-state-active

Executing browser actions:

Executing browser actions: click("22")

In order to accomplish my goal, I need to submit the form. The current observation of the page shows that the "Submit" button is focused.

Executing browser actions:

Executing browser actions: click("19")

In order to accomplish my goal, I need to click on the "Submit" tab.

ui-accordion-header ui-corner-top ui-state-default ui-accordion-icons ui-state-focus ui-state-hover ui-accordion-header-active ui-state-active

Agent reached maximum number of iterations


Instruction: Click on the red colored box.

Click on the red colored box.

Click on the red colored box.

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-color.html

#area { text-align: center; margin: 20px 0; }
#query-color { height: 10px; width: 10px; border: 1px solid black; display: inline-block; margin: 2px 0; vertical-align: middle; }
.color { height: 50px; width: 50px; border: 1px solid black; display: inline-block; margin: 5px; }

var COLORS = ['red', 'blue', 'olive', 'lime', 'black', 'white', 'grey', 'purple', 'orange', 'yellow', 'cyan', 'pink', 'magenta'];
var QUERY_COLOR = `<div id="query-color"></div>`
var MAX_COLORS = 4;

// helper function used to generate the div displaying a color.
var generateColorBox = function(color){
  var div = document.createElement('div');
  div.setAttribute('class', 'color');
  div.setAttribute('data-color', color);
  div.setAttribute('style', 'background-color: ' + color + ';');
  return div;
}

// generate the colors used in an episode.
var generateColors = function(){
  var problemSet = core.shuffle(COLORS.slice()); // make a copy of the colors.

  var currentColors = [];
  for(var c=0;c<MAX_COLORS;c++){
    var currentColor = problemSet.pop();
    var colorDiv = generateColorBox(currentColor);
    d3.select('#area')[0][0].appendChild(colorDiv);
    currentColors.push(currentColor);
  }

  return currentColors;
}

// display the episode problem
var displayProblem = function(expectedColor){
  if(core.randi(0,100) < 40) d3.select('#query').html('Click on the ' + expectedColor + ' colored box.');
  else {
    d3.select('#query').html('Click on the ' + QUERY_COLOR + ' colored box.');
    d3.select('#query-color')[0][0].setAttribute('class', 'color');
    d3.select('#query-color')[0][0].setAttribute('style', 'background-color: ' + expectedColor + ';');
  }
}

var genProblem = function() {
  // reset UI.
  d3.selectAll('#query, #area').html('');

  var currentColors = generateColors();
  var expectedColor = core.sample(currentColors);
  displayProblem(expectedColor);

  d3.selectAll('.color').on('click', function(){
    var color = this.getAttribute('data-color');
    var r = expectedColor.indexOf(color) !== -1 ? 1.0 : -1.0;
    core.endEpisode(r, r > 0);
  });
}

// Override: translate the box into the correct string
// Technically not cheating since the model has access to DOM. This is just a shortcut.
core.getUtterance = function () {
  var query = document.getElementById('query');
  var child = query.children[0];
  var color = (child.tagName == 'DIV') ? /background-color: (.*);/.exec(child.getAttribute('style'))[1] : child.innerHTML;
  return 'Click on the ' + color + ' colored box.';
}

window.onload = function() {
  core.startEpisode();
}

Executing browser actions:

Executing browser actions:

Executing browser actions: click('red-box')

In order to accomplish my goal I need to click on the red colored box.

ValueError: Could not find element with bid "red-box"

Executing browser actions:

Executing browser actions:

Too many errors encountered. Task failed.

No observation

All done! What's next on the agenda?

No observation


Instruction: Close the dialog box by clicking the "x".

No observation

Executing browser actions: noop()

Visited file:///home/fangzhex/miniwob-plusplus/miniwob/html/miniwob/click-dialog.html

<::before><::after> Close

Tempor, metus scelerisque vel. Fermentum.

#area { height: 100px; display: block; }
#dialog { height: auto !important; }
.ui-dialog { font-size: 10px; }
.ui-dialog .ui-dialog-titlebar { padding: 2px 3px; height: 15px; }
.ui-button { outline: 0; }
.ui-dialog .ui-dialog-content { padding: 0px; margin: 0 5px; }

var resetUI = function(div){
  if(div.html().length > 0) $('#dialog').dialog('destroy');
  div.empty(); // clear previous problem, if any
  $.resetUniqueId();
}

var createDialog = function(div){
  var html = '<p>' + ui_utils.generateWords(4,8) + '</p>';
  div.append(html);

  $('#dialog').dialog({ height: 70, position: {my: 'center', at: 'center', of: document.getElementById('area')} });

  $('.ui-dialog')[0].style.margin = core.randi(-10,20) + 'px ' + core.randi(5,25) + 'px';
  $('.ui-dialog')[0].style.width = core.randi(90,120) + 'px';
  $('.ui-dialog')[0].style.height = core.randi(70,100) + 'px';
}

var genProblem = function() {
  var div = $('#dialog');
  resetUI(div);
  createDialog(div);

  $('#query').html('Close the dialog box by clicking the "x".');
  $('button.ui-button').on('click', function(){ core.endEpisode(1.0, true); })

}

window.onload = function() {
  core.startEpisode();
}

ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-draggable ui-resizable

position: absolute; height: 75px; width: 99px; top: 73px; left: 0px; display: block; margin: 15px 23px;

ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix ui-draggable-handle

ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close

width: auto; min-height: 0px; max-height: none; height: 12px;

ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se

Executing browser actions:

Executing browser actions: click("20")

In order to accomplish my goal I need to click on the "x" button to close the dialog box.

position: absolute; height: 75px; width: 99px; top: 73px; left: 0px; display: none; margin: 15px 23px;

Executing browser actions:

Executing browser actions: click("close-button-id")

In order to close the dialog box, the next action should be to click on the "x" button.

ValueError: Could not find element with bid "close-button-id"

Executing browser actions:

In order to accomplish my goal of closing the dialog box, I need to click on the "x" button.

In order to accomplish the goal of closing the dialog box, the next action should be to click on the close button.

No observation

All done! What's next on the agenda?

No observation