Automating Siebel Open UI with Selenium webdriver is somewhat difficult if you approach it as you would any other web automation, but with a few tips and tricks, you’ll be amazed at what you are able to accomplish in such a dynamic environment.
My webdriver examples are in Python for a variety of reasons. Python is syntactically easier to read and write, Python implements the data types we’ll need to parse some of the Open UI muck quite well, and Python is just more fun. I strongly recommend it for more than just this, but the data structures I’ll use are not unique to the language, and I’m going to describe the data structure employed (a unique list) instead of the language specific type (Python set).
What will we accomplish here?
I’ll describe a different type of navigation and content tracking which simplifies the input/output and comparison. Wherever there is a chance of reducing Siebel Context, and reducing complexity of results, I will use it, and recommend you do too. The goal is to give you tricks and tips to write scripts that are somewhat generic, and can be applied or modified slightly to work within the parameters of your automation goal. This means you’ll be prepping your Siebel instance with the correct page, limitations, context, and query, and then running the automation through the “Click next and gather/compare” parts of your task cleanly.
This is managed automation, and it’s designed to be a set of snippets or functions that can be called upon in a generic and widely applicable manner. It could be “set and forget” though there would be significantly more hardcoding, and be susceptible to Siebel’s arbitrary dropping of sessions (or maybe that’s just us).
In short, this is not an automation suite. It’s more of an augmentation to an intelligent Siebel analyst and semi-programmer.
How Do You Know Enough About Our Siebel Environment To Help?
I don’t. Basically everyone’s Siebel is custom, but they all use similar data and UI elements and query styles. I apologize that I can’t be of direct help, but I have to make things pretty generic, and as standardized as possible. If things still don’t work, send me an email and I’ll try to help!
Before You Automate: Build Powerful Queries
Narrowing context is the easiest way to check things within Siebel. An extremely well-formed query may eliminate the necessity of even having to automate. Simply running a query so complete it encompasses all your parameters and returns zero results is a lot of time saved.
Use OR queries whenever possible to narrow your results. I made a quick OR tool that allows you to paste a long column of entries in, and the output is:
entry 1 OR entry 2 OR …
This enables you to make very targeted queries, and make use of Siebel Open UI’s context levels query for multiple items, open a subview, apply a restrictive query to the sub-view, and then flip to the next item without backing out of the subview. Taking advantage of Siebel’s layered structure like this has saved HOURS (and sanity!) per day. NOTE: Some elements require surrounding double quotes. So I added to that tool the ability to add something before and after each entry:
[Id]=”entry 1″ OR [Id]=”entry 2″ OR …
Bypass query form limits by identifying the actual SQL elements being called. This extends your ability to query to fields you might not have had the option to query or even see on the list! The common one is querying a row ID by inputting into any field of a query [Id]=”something”. It’s a valid query.
This is not a query-able field available in the UI, but it will process and return results. Frequently specific columns are not query-able due to design decisions. You may be able to bypass these limitations by identifying the Property Names for the field you’ve clicked into, and querying for those as we did the “Id” above.
Click into the field you want to query against, and open your browser’s java console (likely Ctrl+Shift+J), to where you have a blinking cursor. For getting We settled on the following code which should either work perfectly for you, or require only slight adaption.
The results of this Java script should be a list of what are basically table column names. These will allow you to query for columns previously unavailable. My experience has been that almost all information that displays on the UI has a place in the SiebelApp Java script object. Poke at it. It’s easy to get lost, but it’s probably all there.
Aim for zero query results. Try to make your queries so the results of your testing will be either blank or populated. If you’re flipping through items, looking for the ones that have the “ASDF” line item, then narrow your query in the subview to only those entries which have “ASDF” in that column. Your results should either be one or many lines, or a blank listview. This is MUCH easier to process visually, and allows you to use keyboard shortcuts to move to the next record (Alt+.), watch the subview update, and move on. You can flip through hundreds of records in this fashion in minutes.
For blank fields, make use of the IS NULL and IS NOT NULL arguments. If you’re looking for elements which lack information in a certain column, you can query and write in that column IS NULL and receive elements which have no value in that field. NOTE: A field with a blank space or erased entry is not necessarily NULL, it might be ” ” or even more fun ” “. Big data has afforded us the amazing ability to review the astonishing stupidity of the data inputed by frustrated humans. Truly mind boggling. Anyway…
Match or don’t match multiple values in your queries. This is basically SQL, but you can query multiple possibilities in fields. Find statuses that are Inactive or Disabled? Write just that into the query; Inactive or Disabled. But the opposite? NOT LIKE Inactive OR Disabled.
Always remember Alt+G to Refine Query. This allows you to build complex queries and update and modify as you go, rather than starting a fresh query each time. NOTE: Copy what you paste into the fields, because after Siebel processes the results, it may put bad characters into your query, and if you build of of it or even re-run it, Open UI may complain there’s a bad character in one of the fields after you just ran it. In these cases, erase and re-paste your query into that field.
Ready for Part 2 where we get into actual webdriver automation tips? Shoot me an email! It’s always hard to tell where to spend time writing, so let me know it’s what you’d like to hear!
© Copyright applies, details in sidebar