• Share
  • ?
  • Profiles ▼
  • Communities ▼
  • Apps ▼

Blogs

  • My Blogs
  • Public Blogs
  • My Updates
  • Administration
  • Log in to participate

▼ Tags

 

▼ Archive

  • January 2017
  • November 2016
  • September 2016
  • May 2016
  • February 2016
  • December 2015
  • November 2015
  • September 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • November 2014
  • October 2014
  • May 2014
  • March 2014
  • September 2013
  • August 2013
  • March 2013

▼ Blog Authors

MrCoolK

View All Entries
Clicking the button causes a full page refresh. The user could go to the "Entry list" region to view the new content.) Entry list

RFT update Object Property In TestObject

MrCoolK 270003CDF9 | ‎ | 2,605 Views

This method will illustrate how to update the object in object map.

/**
     * This method shows an example how you can update a object property in Test
     * object map.<br>
     * This method will update an object that has property .class="Html.A" and
     * .classIndex="12".<br>
     * It will update the .text property to "381176".<br>
     * Jul 9, 2015
     * 
     * @author mrCoolK
     */

    public void updateObjectPropertyInTestObject() {
        Enumeration<MappedTestObject> elts = getMap().elements();
        while (elts.hasMoreElements()) {
            MappedTestObject obj = elts.nextElement();
            MappedTestObjectProperty toProperty1 = obj
                    .getPropertyData(".class");
            MappedTestObjectProperty toProperty2 = obj
                    .getPropertyData(".classIndex");
            try { // try catch because all object might not have the property
                    // you are trying to find.
                System.out.println(".class :" + toProperty1.getValue());
                System.out.println(".classIndex :" + toProperty2.getValue());
                if ((toProperty1 != null)
                        && (toProperty1.getValue().toString().equals("Html.A"))
                        && (toProperty2.getValue().toString().equals("12"))) {
                    obj.setProperty(".text", "381176", 100);// Property,value,weight
                    System.out.println("Properties changed !!");
                    break;
                }

            } catch (NullPointerException e) {

            }

        }

        // store back in file for future use.
        ObjectMap.store(getMap(), getMap().getFile());
    }
    
}

  • Add a Comment Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry
Notify Other People
notification

Send Email Notification

+

Quarantine this entry

deleteEntry
duplicateEntry

Mark as Duplicate

  • Previous Entry
  • Main
  • Next Entry
Feed for Blog Entries | Feed for Blog Comments | Feed for Comments for this Entry