I needed to create 50 names that were similiar and incremental (ex: Tracey1, Tracey2, Tracey3, etc.). I used javascript to increment the numbers.
<!--Here I store the alpha-text part of my name as variable 'a'. This allows me to change this later to something else.-->
<tr>
<td>store</td>
<td>Tracey</td>
<td>a</td>
</tr>
<!--This increments the number ('y'), starting at 1-->
<tr>
<td>store</td>
<td>1</td>
<td>x</td>
</tr>
<tr>
<td>storeEval</td>
<td>storedVars['x'] = ${x}+1</td>
<td>y</td>
</tr>
<!--Here I type the name-->
<tr>
<td>type</td>
<td>fieldname</td>
<td>${a}${y}</td>
</tr>
<!--And the next time I need to type the name, I just increment 'y' by one-->
<tr>
<td>storeEval</td>
<td>storedVars['y'] = ${y}+1</td>
<td>y</td>
</tr>
<tr>
<td>type</td>
<td>fieldname</td>
<td>${a}${y}</td>
Wednesday, February 23, 2011
Friday, August 27, 2010
Oracle Dates and Timestamps
Date/Timestamps in Oracle make be break out into hives. And then I start to miss MS SQL Server.....a little.
Oracle does not like to return timestamps when querying date/time fields; so sometimes I have to use something like this:
SELECT to_char(to_timestamp(to_char(a.fieldName, 'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS'))
FROM tableName a
Saturday, August 7, 2010
SpiraTest Tips
- Make your test case names as short as possible. On some screens, SpiraTest only shows so many characters of the test name, so shorter is better.
- I had trouble changing the font on the Test Steps. I had to view the step in HTML (a button when you're editing the step) and edit the HTML to change the fonts. I pretty much gave up on doing this b/c it's a waste of time.
- Be careful navigating away from a test you are writing. SpiraTest will not warn you that you haven't saved your changes.
- On the Test List screen, "Show Level" may need to be changed in order to view all tests
Non-Invasive VPN
If you need to route only certain traffic over a VPN connection, do the following:
with the actual IP the VPN assigned you.
.
- After setting up the VPN connection, open up the Connect screen.
- Click on Properties and go to the "Networking" tab.
- Select Internet Protocol and click on Properties.
- Click Advanced and go to the "General" tab.
- Uncheck "Use default gateway on remote network."
- Click OK 3 times to get back to the connect window.
- Connect.
- Open a command prompt and run
ipconfigto see what IP the VPN server assigned you. - Run the following command: route add 192.62.174.0 MASK 255.255.255.0
Checkboxes and Selenium
When checking (or unchecking) a checkbox, Selenium IDE might record something like this:
click - chckbx_0_0
Both the command and the location are ambiguous.
For example, let's say you're trying to uncheck BoxA. "Click" is ambiguous because if BoxA is already unchecked, you'll check it by clicking the checkbox. "chckbx_0_0" is ambiguous as a locator because if checkboxes are added or removed from the screen in the future, "chckbx_0_0" could identify a different checkbox.
Use this instead:
command = uncheck (or check)
target (location) = relative xPath of the checkbox element
click - chckbx_0_0
Both the command and the location are ambiguous.
For example, let's say you're trying to uncheck BoxA. "Click" is ambiguous because if BoxA is already unchecked, you'll check it by clicking the checkbox. "chckbx_0_0" is ambiguous as a locator because if checkboxes are added or removed from the screen in the future, "chckbx_0_0" could identify a different checkbox.
Use this instead:
command = uncheck (or check)
target (location) = relative xPath of the checkbox element
Of course, Selenium IDE recorded ambiguously on my project in this particular scenario. It will record differently depending on the application.
XPath and Selenium Locator Information
I often need to use a relative XPath to locate elements in Selenium. A few reasons to use relative XPath:
- The ID of the element changes every time you go to the page.
- You suspect the element could change location in the future and the locator recorded by Selenium IDE is too ambiguous to handle changes in the future.
Here's some excellent information on Locators in Selenium: http://seleniumhq.org/docs/02_selenium_ide.html#locating-elements
I often refer to http://www.w3.org/TR/xpath/ , particularly sections 2 Location Paths, 2.2 Axes, 2.5 Abbreviated Syntax.
Creating an Oracle database and importing a dump file
It's not too often that I need to create a new database. Since I rarely do this, I wanted to jot down some notes for next time. Thanks to the developer/dba for the help. Of course, these steps will vary a little depending on what you want to do.
One way to create an Oracle db using Windows:
(I created an 11g db)
- Open DBCA (probably in C:\Oracle\product\11.1.0\db_1\BIN).
- Hit Next.
- Select Create a Database and hit Next.
- Select General Purpose or Transaction Processing and hit Next.
- Enter a Global Database Name (use this as your SID) and hit Next.
- Unselect Configure Enterprise Manager and hit Next.
- Select Use the Same Administrative Password for All Accounts and enter ‘password’ in each box. Click Next.
- Click Finish.
- Click OK on the box that pops up.
- After the database creates successfully, exit DBCA.
After creating the database, I needed to import a dump file. So first I had to set up the import directory, and some tablespaces and roles needed for the import.
In this example, 'C:\tmp' is my import directory, where the dump file is located:
CREATE OR REPLACE DIRECTORY import_dir AS 'C:\tmp';
COMMIT;
I needed to setup a profile for my db:
CREATE PROFILE APP_PROFILE
LIMIT FAILED_LOGIN_ATTEMPTS 10
PASSWORD_LIFE_TIME 180
PASSWORD_LOCK_TIME 1
PASSWORD_GRACE_TIME 7;
COMMIT;
Examples of setting up tablespaces and roles:
CREATE TABLESPACE TABLE_INDEX01 DATAFILE 'C:\Oracle\oradata\[insert SID here]\table_index01.dbf' SIZE 1000m AUTOEXTEND ON MAXSIZE 2000m EXTENT MANAGEMENT LOCAL UNIFORM SIZE 5m;
COMMIT;
CREATE ROLE TEST_DBA IDENTIFIED BY TEST_DBA;
COMMIT;
Then I ran the following command to import the dump file:
%ORACLE_HOME%\bin\impdp system/password full=y directory=import_dir dumpfile=name_of_dump_file.dmp nologfile=Y
You can use the DBCA tool to delete databases also.
When I tried to connect to my new database in SQL Developer, I ran into some errors. You need to make sure your Listener is running before you can connect. At a command prompt:
> LSNRCTL
> status
If you receive an error, start the listener:
> start
Subscribe to:
Posts (Atom)