Wednesday, 13 May 2015

OATS and automated regression testing

I’m finding this story is getting better and better.

A number of distinct things are pushing me in the direction of automated regression testing:

  1. It works between tools releases, even 9.1.4 and 9.1.5 which has a large difference in look & feel
  2. It’s very easy to use, record and maintain
  3. You can import UPK test scripts directly into functional test cases
  4. You can take advantage of “testing as a service” easily

Let’s look into these in more detail:

It works between tools releases, even 9.1.4 and 9.1.5 which has a large difference in look & feel

I’ve recorded a number of scripts against an old tools release and then tried running them against the new, and in many instances, this just works.  I guess that the magic is in the identification of the elements on the forms and the fact that much of this does not change.

Let’s look at (for example) if OATs wants to record you clicking the find button, it uses a reference (Path) like the below

image

or syntax like window:iframe:img identifier

/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:img[@alt='Find (Ctrl+Alt+I)' or @id='hc_Find' or @index='6' or @src='http://e1ent-dnt.mits.local:9081/jde/img/hc_Findmo.gif']

And actually looks like this code in java – which is essentially clicking the image hc_Findmo.gif

			web.image(
1053,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:img[@alt='Find (Ctrl+Alt+I)' or @id='hc_Find' or @index='6' or @src='http://e1ent-dnt.mits.local:9081/jde/img/hc_Findmo.gif']")
.click();

The chrome browser can also indicate the exact same information in developer mode


image


this provides a generic path to the object on the form.  No matter what styling goes on (css etc), the path maintains it’s accuracy between tools releases:


image


But you can see that the path (unique method of identifying the object on the form) is maintained between the tools release.


So, you’ll find that many of your scripts will also survive.


I was amazed that the fast path continued to work between the tools release, and that is only some nice code that keeps this working.


It’s very easy to use, record and maintain




image


You can quickly do a lot of testing with some very simple recording.  The power of databanks and simple editing techniques in the scripts allows you to quickly create some generic testing capabilities.  In fact, the combination of SQL scripts (oracle DB connect to find data) and regression testing with dynamic data can allow a generic testing service to test standard functionality.


The tool just records what you do and gives you a pretty easy interface to augment or change and of the tests that you want to do.  Really, very simple.

			web.element(
1193,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:nobr[@innerText='Regional Info ' and @text='Regional Info ' and @jdeWebGUIPopupMenu='yes' and @disabled='False' and @onblur='null' and @onclick='null' and @ondblclick='null' and @onfocus='null' and @onkeydown='null' and @onkeypress='null' and @onkeyup='null' and @onmousedown='null' and @onmousemove='null' and @onmouseout='null' and @onmouseover='null' and @onmouseup='null' and @tabindex='0' and @index='21']")
.assertAttributes(
"Check Regional infor button",
web.attributes(web.attribute("tag", "NOBR",
TestOperator.StringExact), web
.attribute("innerText",
"Regional Info ",
TestOperator.StringExact), web
.attribute("text", "Regional Info ",
TestOperator.StringExact), web
.attribute("jdeWebGUIPopupMenu", "yes",
TestOperator.StringExact), web
.attribute("disabled", "False",
TestOperator.StringExact), web
.attribute("onblur", "null",
TestOperator.StringExact), web
.attribute("onclick", "null",
TestOperator.StringExact), web
.attribute("ondblclick", "null",
TestOperator.StringExact), web
.attribute("onfocus", "null",
TestOperator.StringExact), web
.attribute("onkeydown", "null",
TestOperator.StringExact), web
.attribute("onkeypress", "null",
TestOperator.StringExact), web
.attribute("onkeyup", "null",
TestOperator.StringExact), web
.attribute("onmousedown", "null",
TestOperator.StringExact), web
.attribute("onmousemove", "null",
TestOperator.StringExact), web
.attribute("onmouseout", "null",
TestOperator.StringExact), web
.attribute("onmouseover", "null",
TestOperator.StringExact), web
.attribute("onmouseup", "null",
TestOperator.StringExact), web
.attribute("tabindex", "0",
TestOperator.StringExact), web
.attribute("index", "21",
TestOperator.StringExact)));
web.addGlobalVerifyText("CheckFormName", "Work With Addresses",
Source.DisplayContent, TextPresence.PassIfPresent,
MatchOption.Exact);
}
web.textBox(
1051,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:div[@id='HDR_DIV0_1.1' or @text='Alpha\r\nName' or @index='64']")
.click();
{
think(1.573);
}
eone.grid(
1052,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:EOneGrid[@gridName='Work With Addresses' or @gridId='0_1']")
.setQBEValue(0, "121");
{
think(1.201);
}
web.image(
1053,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:img[@alt='Find (Ctrl+Alt+I)' or @id='hc_Find' or @index='6' or @src='http://e1ent-dnt.mits.local:9081/jde/img/hc_Findmo.gif']")
.click();
{
think(2.464);
}
web.element(
1054,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:div[@text='12121' or @index='99']")
.click();
{
think(1.452);
}
web.image(
1055,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:img[@alt='Find (Ctrl+Alt+I)' or @id='hc_Find' or @index='6' or @src='http://e1ent-dnt.mits.local:9081/jde/img/hc_Findmo.gif']")
.click();
{
think(1.612);
}
web.textBox(
1056,
"/web:window[@index='0' or @title='Work With Addresses']/web:document[@index='10' or @name='e1menuAppIframe']/web:form[@id='E1PaneForm' or @name='P01012_W01012B' or @index='2']/web:input_text[@name='qbe0_1.0' or @index='2']")
.click();
{
think(0.22);
}

The above shows the level of code and how easy it is to change something if a developer or ESU has actually changed the internal ID of a field.  The other nice think is that it identifies with a bunch of “OR”s.  So, it checks for index OR name OR id – problem is when things have moved around – the wrong field might begin to get tested.  It’s simple to verify this in E1, especially looking in chome in developer mode.


You can import UPK test scripts directly into functional test cases


This is precisely what you should be doing.  Testing what you train on, train on what you test.  Therefore having UPK scripts create regression test scripts, that can be executed in a hierarchy in a single click is amazing!  You need to change the way that you test.  Your testing people need to be junior developers (java) and work with BA’s from the business.  Or perhaps the BA’s just write the UPK content and the junior developers write and maintain the test scripts.


The automated testing makes the decision to take an ESU MUCH easier, as you can automate an entire CRP / UAT test cycle in days with 0 users.  You can get graphical reporting and understand exactly where the failures occurred.


This is a powerful enhancement that is sure to get more people using OATs test manager and regression testing.


You can take advantage of “testing as a service” easily


Finally and perhaps most importantly, this opens the door to “testing as a service”, which could be completely generic web based testing.  You’d be asked to provide some data ranges and details of modifications – but the OATs regression testing could do the rest.


The test’s could log in, tell you the app, modification history, last to change, dynamically find some data to test with using database queries and then execute a COMPLETE set of testing over a large range of data (let’s imagine address book for example).  Once complete, email a client the summary of the test results.  Too good to be true – no!  This is being done (by Myriad IT) now!


The service is getting better and better all of the time.

1 comment:

Ipohtech said...

Hi,Shannon
Nice to have you here ...i am in the midst of running OATS in my demo junior E910, can i have this OAST to test my E1 application and find out why my E1 web sometimes would be sluggish loading its page...

tqvm

Extending JDE to generative AI