OpenScript: How do you test for object/text existance programmatically?

Hi, All;
I hope someone can help me; kind of new to OATS. I can’t figure out how to test for object/text existence and return results back to the script. There are methods for verifying text and objects; i.e.
Web.verifyText
Web.assertText
These methods just report pass or fail to the test. I need to get the data back programmatically so I can use it logically. I know you can do this pretty easily in Selenium and QTP so there must be a way in OATS.
Thanks,
Eric

Hi Eric,
You can use the Object Explorer to find the xpath of the object you are interested and check for its existence, and then grab some attribute of that object for use elsewhere.
if (web.element(6,"/web:window[@index='0' or @title='Software and Services - SCL']/web:document[@index='0']/web:span[@text='Services' or @index='14']")
                         .exists()){
          System.out.println("OBJECT EXISTS");
// get an attribute of object here ,e.g
String myval = web.element(41,"/web:window[@index='0' or @title='Software and Services - SCL']/web:document[@index='0']/web::span[@text='Services' or @index='14'].getAttribute("innerText");
// use myval elsewhere
Hope it helps.
Jamie

Similar Messages

  • How do you test for end of page

    I have created a report and would want to find a way of checking if it's almost end of page so that if there are more records to be displayed, the report should display the column headings and new data on a new page instead of displaying part of the data or only headings on the previous page and continue onto the next page.
    The report displays a student's results for each course done. For example, Course 1 and the column headings(year, module, grade) and the actual data (results) then Course 2 and the column headings and data. If it is near end of page after Course 1 results have been displayed, I would like report to display Course 2 results on the next page.
    How do I check in the report if it's end of page or near end of page? Please assist.

    Hi,
    take a look to the following How To support notes that can give you some ideas.
    Reference
         How to reset page number for each master without counting master page (Doc ID 75096.1)
         How to create a 'continue on page...' message on reports with more than one page (Doc ID 120942.1)
    Regards, RZ

  • How do you test any SAP objects before a transport to the production server

    How do you test any SAP objects before a transport to the production server?

    Hi Rama Krishna,
       The actual process is develop the object in development system and unit test there with the available data.
      Then move it to Quality server where the data will be the actual replica of production and where the integration testing and ened to end testing happens and also the user acceptance testing  happens there.
    and once everything is found fine there then it is moved to production system.
    Award points if this is helpful.
    Regards,
    Ravi G

  • How do you change size of text cursor or 'insertion point' in adobe cc for mac?

    how do you change size of text cursor or 'insertion point' in adobe ID cc for mac?  I have looked everywhere.  It's possible in Windows and Word but not in Mac.  Please help.  I spend half my time trying to find that blinking upright bar.

    Thanks for your note but it’s still a skinny rod that seems to disappear.  Why can’t it become a little thicker so it doesn’t disappear no matter what size I have set the screen?  My poor old eyes aren’t what they used to be.  I do appreciate your answering and I’ll enlarge the screen so the blankety-blankety blinking rod is at least visible.  Nancy
    how do you change size of text cursor or 'insertion point' in adobe cc for mac?
    created by Peter Spier in InDesign - View the full discussion
    Cursor size is governed by the type size and will be be larger or smaller on screen depending on how close you are zoomed in.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6729964#6729964
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • How Do You Test a Flash Drive for Errors Using OS X?

    HI. In Windows there are Flash Drive tester that tests if there's something wrong with the Flash drive's chips. How do you test a flash drive for errors on OS X? I bought the HP v220w which is tiny for a 16GB and it's metal. The whole thing goes into the plug. Design wise, it is great, it's very elegant like a jewelry. Thanks in advance.
    Gbu.

    Format it for OS X and run a surface scan on the partition. That should show any hardware problems that don't keep it from working altogether.

  • How do you select an object that is directly under another object?

    How do you select an object that is directly under another object?
    I was working from a template and I wanted to make a text box the same size as a column box that was put there in order to keep the text in the confines of the paper that is was being printed to.
    I could actually put text in each column fine but I wanted it to be in a text box so that I could slightly tilt the test box to compensate for my printer feeding it in slightly wrong. I accomplished this on another template but I could not on this one. If I was working in InDesign or something I know I could just select that layer but I'm at a loss of what to do here. How do I select a column right under a text box? I just thought of something. Once I make the text boxes the same size as the columns I think I can just delete the columns from the inspector. But that would be kind of a work around. I know you can hold down command when nothing is selected from outside the document and then highlight but this is not working. Does anyone have some tips and tricks when it comes to having control over which objects you are selecting when it comes to objects that are overlapped as well as directly over each other.
    Thanks.
    Tim

    I'm not sure it's documented any where, but it's not too difficult. First, ⌘-click outside of the layout area to enter object mode then drag the cursor towards the two objects until you see the handles. Now, again ⌘-click on the top object to deselect it. You can now move the underlying object to the front to edit, delete, etc.
    After typing this, it dawned on me, why not just click the top object to select it & move it to the back? I've only done the other way a bazillion times & now I think of this.

  • How do you test your new laptops?

    To the gurus or people who have researched this question:  How do you test your new laptops?
    When you get a new laptop, what do you do to test it?
    My X1Carbon might arrive in a couple weeks, and reading about all the failures and DOAs is scary. So assuming mine is not simply DOA, how do you shake out the less obvious or more obscure problems?
    I did search for this info before posting. One other person asked the question, 
    >> Would appreciate advice re optimal set-up and what testing/diagnostics to do to determine if ther...
    but no one answered.

    With testing I start with the basics and work my way to the harder stuff.
    Inspect the external condition of the machine.
    Boot and enter the BIOS before Windows. Review settings then power off.
    Boot from Acronis True Image Home backup/recovery DVD and clone HDD or SSD and thus the factory image before it's ever booted to Windows.
    Boot to Windows and look carefully at the Lenovo factory image and try to get an understanding for the Lenovo software and why it is there.  This does not include the other software from Microsoft, Google, etc.
    Create Lenovo Factory Image DVD set with Rescue and Recovery.  Throw disk set in the box or put on the shelf in case the machine is ever re-sold.
    Test all of the ports - I test every port on the machine for my expected usage.  For instance, in the case of the X1 Carbon I would confirm the mini DisplayPort connection works correctly with an external LCD panel.  If the machine had a IEEE firewire port or something, test that.  Test the USB 3.0 ports with a known working external external enclosure and verify transfer speeds.
    Test the SSD speed with CrystalDiskMark, ATTO and AS Disk Benchmark software to get a good overview of the performance.
    Install HWiNFO and look carefully at the components.  Observe turbo boosting, thermals and fan RPM over the course of a few days for battery and AC power.
    Do at least one full battery discharge and recharge.  Observe the cycle and details are being properly displayed and recorded in Lenovo Power Manager.
    Download all software and drivers from support.lenovo.com for the model being tested.  Confirm visually you have all the core components needed.  Core includes the drivers, power management driver, Power Manager, hotkeys, etc.
    Flatten the machine and install Windows or Linux from scratch.  Install drivers and software.
    Re-test ports and confirm the machine is working properly.
    Benchmark the SSD again.  Confirm no change.
    Install HWiNFO and confirm turbo, thermals and fan speeds are still proper.
    Install core applications and test them.  There may be core features in Windows that also need to be installed and tested.  For instance, Windows 8 Hyper-V for virtualization. 
    Connect any external devices you expect to use and test them.  For instance, video cameras, smartphones, mp3 players, digital cameras, printers, USB docks, etc.
    Do several battery tests with your typical applications and behavior.  The goal here is to simulate how the machine will be used in your day-to-day setting or travel scenarios.  I usually do at least three tests.  This can be rather time consuming with long battery life machines so I get a lot of other testing out of the way first.
    By the time you get to this point, if you haven't hit any major roadblocks you'll start to have a good feel for the machine, and if it is going to be a keeper or not.  The assumption here is that during this timeframe you have been observing the screen, keyboard, and trackpad performance to see if it's to your liking.  The other assumption is that you are using the machine and applications in the scenarios you are purchasing it for.
    I don't run synthetic benchmarks.  I prefer to test a machine against the scenarios I expect to use it with.  I spend most of the first week making this assessment.  If any major hardware defects are present, the machine is automatically returned.  I do not repair machines just received.  No exceptions.
    Week 2 is for ironing out any minor issues and assessing if the machine meets the requirements for the scenarios it will support.  If it does, it is kept.  If it does not, it is returned.  This week includes subjective and objective input.  You have to weigh the pros and cons for a machine against your priorities. It is rare that a machine is perfect so you have to decide the ROI for the machine.  Service and Support must be considered so week two might include a call to support for any unresolved issues.  Don't discount the service you receive during this period.
    After week two, you are likely right on top of the last day to return a Lenovo machine.  The return period is 21 days from the invoice date (I believe), not the day the machine is received so make sure you are well aware of it.  After 21 days, the machine is yours for good unless you sell it.  Decision time.
    Good luck.

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How do you get your ring/text tones that were purchased back on your phone

    how do you get your ring/text tones that were purchased back on your phone

    Hey there oops31,
    Welcome to Apple Support Communities.
    It sounds like you want to know how to get tones that you’ve previously purchased on your iPhone 4s. The article linked below outlines the options for downloading past purchases and includes information about syncing tones from iTunes to your iOS device.
    Download past purchases - Apple Support
    Audiobooks, ringtones, and tones
    If you made a backup of these items on your Mac or PC, you can sync the items to your iOS device. You can't download these items again from iTunes in the Cloud.
    Cheers, 
    -Jason

  • How to add services for object in ECC6.0

    Hi everybody,
                        Can anybody tell me how to add "Services for Object" icon in ECC 6.0 because this icon is there in 4.6C but not coming in ECC 6.0.
    Thanks in Advance

    Hi Saurabh,
                Thanks for your reply. I have checked the path given by you...System-> Service for object, but it is showing no service available as told by you. Cud you please tell me how to add this service because this is working fine in 4.6C but I dont know how to add these services in ECC 6.0. If any code for this which is written in 4.6C which I can refer... please tell me where to see the code for adding services (in 4.6C)  b'coz its very urgent.

  • How can I test for the bas unit enterd in a control?

    How can I to create a polymorphic vi where the user can enter either volume or temperature.
    how can Labwiev test for the base unit entered
    pseudocode example:
    input X
    if X.base_unit == m^3 do ....... 
    thanks for any suggestion to resolve or avoid my problem
    Solved!
    Go to Solution.

    Hi schaerm,
    you have to dig deeper.
    An idea is this one:
    The red marked word is containing the unit - in a coded way. Somewhere in the LV help you can find the description of this coding (I remember a chapter on memory representations of all LV datatypes...). (There surely is an easier or better way - but the example is done quic&dirty.)
    You can also format the number into a string and analyze the unit here...
    Message Edited by GerdW on 02-07-2010 07:21 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How do you copy, for example I work with blue prints and I want to copy a section and copy into another new page?

    How do you copy, for example I work with blue prints and I want to copy a section and copy into another new page?

    Forgot to add that it would be an adjustment layer with some kind of mask on it already. The mask is uncentered when copy and pasted which throws it off.
    I guess the same question would go towards doing the same for an object. How to copy and paste it over to a new doc, keeping its position within the document? is this possible?

  • How do you test an Alert?

    How do you test an Alert?

    Hi,
       Please find the folloing links, which will you some extent.
    Triggering Alerts
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    Setting up alerts
    Setting up alerts in RZ20
    Alert Management
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e04141e8-0f11-2a10-adaa-9d97b062c2df
    Alert Notification
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90f449a8-a6db-2910-a386-d2b5999f5751
    Custom Alerts in CIC Win Client for CRM 5.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/601db2b2-2839-2a10-0381-8807979f6ff8
    Understanding u'r SAP EarlyWatch Alert Report
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4b88cb90-0201-0010-5bb1-a65272a329bf
    regards
    mahesh.

  • How do You Test EMail Connectivity?

    How do You Test EMail Connectivity?
    Once you setup the mail gateway with an IP address, port, and domain name.  How can you test email connectivity?  How do you force the MARS Appliance to send an email?

    There is no "test e-mail connectivity" button/function. Essentially you need to configure inspection rules to notify you when they are fired by mars.
    You will need to setup a user (preferably a non-admin account for testing) under "Management"-"user management"(if you haven't already done so) make sure to supply e-mail address.
    http://www.cisco.com/en/US/docs/security/security_management/cs-mars/6.0/initial/configuration/setup.html#wp1030836
    Now you can "Configure a Rule to Send an Alert Action." the following link explains how to do this...An easy one would be the "System Rule: CS-MARS Login Failures - Non-Admin User" rule. Follow the instructions in the link below under the "Configure a Rule to Send an Alert Action" section to modify the rule mentioned above. Keep in mind that this rule only fires when there are login failures. Once you have modified this rule try logging into mars using the non-admin user with a bad password...you should get a e-mail from MARS.
    http://www.cisco.com/en/US/docs/security/security_management/cs-mars/6.0/user/guide/combo/alerts.html#wp1056101
    Hope this helps.
    Dustin Suko

  • How do you test your Java Pricing UserExits in eclipse?

    How do you test your Java Pricing UserExits in eclipse?

    do you have to deploy the java class on vmc server to debug it
    Yes
    - So, the classes have to be compiled error free and uploaded to VMC.
    - VMC has to be restarted to test your classes.
    - You have to set the log levels appropriately for your classes using SM53 / SM52.
    -  You can also perform VMC debug through Eclipse.
    all of the details are available in the pricing exit manual*

Maybe you are looking for