How to create automated test case to check the omniture tag which is in http query string parameters

1,133 views
Skip to first unread message

Asotha Ponnusamy

unread,
Mar 12, 2015, 7:24:20 AM3/12/15
to seleniu...@googlegroups.com
Hi All,

I am trying to create a test case for the web analytics, we have added name/ids to the links and buttons in the website. All my test cases are in selenium. now i want to verify the value of the omniture variables which is in query string parameter in http, which we will see in query string paramerter in the network tab during manual testing


Krishnan Mahadevan

unread,
Mar 12, 2015, 10:17:08 AM3/12/15
to Selenium Users
What you need here is a proxy server such as BrowserMob Proxy

Take a look at its documentation : https://github.com/lightbody/browsermob-proxy

Once you have a BMP server up and running you just need to embed its ip and port as the proxy server into your capabilities and the rest will be taken care of by BMP. Once your test is done you can query the har (HTML Archive) file that BMP generates (its in JSON format) and then you can work with it for your validations.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Mar 12, 2015 at 12:53 PM, Asotha Ponnusamy <aso...@gmail.com> wrote:
Hi All,

I am trying to create a test case for the web analytics, we have added name/ids to the links and buttons in the website. All my test cases are in selenium. now i want to verify the value of the omniture variables which is in query string parameter in http, which we will see in query string paramerter in the network tab during manual testing


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/77835989-d0b2-43d6-9e4e-638689aba907%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Asotha Ponnusamy

unread,
Mar 12, 2015, 12:57:15 PM3/12/15
to seleniu...@googlegroups.com
Krishnan,

which IP and port i should embed. i saw some sourde code but i couldnt understand. can u elaborate

Asotha Ponnusamy

unread,
Mar 12, 2015, 1:05:04 PM3/12/15
to seleniu...@googlegroups.com

Krishnan,

which IP and port i should embed. i saw some sourde code but i couldnt understand. can u elaborate.

Also i could see in internet that this will create some .har file..

My intension is to check whether the omniture variables are having correct value.
I want to get the variables for the current user click(call) and compare with the value which i have(expected value). can i do this with this proxy 

Krishnan Mahadevan

unread,
Mar 12, 2015, 1:20:35 PM3/12/15
to seleniu...@googlegroups.com
I would recommend that you please go through the documentation for bmp try it out and if you face any issues with it post your query on the bmp google forums. Your requirement can very well be done if you integrate your selenium tests with a proxy server such as bmp. 

Krishnan M
iSent.iPad.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

David

unread,
Mar 12, 2015, 3:51:22 PM3/12/15
to seleniu...@googlegroups.com
I would also like to point out that, while the proxy approach is the best route, for end to end validation, you can at least verify the client side functionality of Omniture, that it is setting the correct values by running javascript code to return the variable values for you to assert against. The exact variables depend on your Omniture setup/implementation, consult your Omniture expert in your organization. It would go something like this:

String value = ((JavascriptExecutor) driver).executeScript("return scode.prop43;"); //or scode.eVar54, etc.

You would extract or query these variable values after you know they have been set. e.g. for page load events, they should already be set after page loads. for click and other events, you have to trigger it by clicking the relevant element that would then have Omniture set the value. Then you query the value to assert against.

Note however, that with this technique, on some events that take you to a new page (e.g. a page load that redirects to another page, or a click event that loads a new page), you may not be able to effectively query the Omniture values - only works when you are on the same page and not a new page. So in this case, you would need the proxy method to verify when there are new page (redirects).

We've used this javascript method in our organization since we don't deploy proxy servers (yet).

prem kumar

unread,
Oct 25, 2016, 1:32:30 AM10/25/16
to Selenium Users
Hi David,

what is scode, I mean how did you arrive to get that information. Its says undefined for me

⇜Krishnan Mahadevan⇝

unread,
Oct 25, 2016, 1:40:35 AM10/25/16
to Selenium Users
Prem,

scode was just meant to be an example and NOT meant to be copy pasted and used directly. 
The actual variable names will depend on how your web application has integrated itself with site catalyst/omniture.
That explains why you see an un-defined message.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/824b31f2-41a8-4952-8fa7-4a12c5444b7f%40googlegroups.com.

KAPIL MEHTA

unread,
Nov 27, 2016, 12:03:09 AM11/27/16
to Selenium Users
We can open SC debugger with below script and then switch focus to newly opened browser(ff) window and do regular testing as we do with selenium.

((JavascriptExecutor) sharedDriver)
                    .executeScript("javascript:void(window.open(\"\",\"dp_debugger\",\"width=600,height=600,location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1\")).document.write(\"<script language='JavaScript' id=dbg src='https://www.adobetag.com/d1/digitalpulsedebugger/live/DPD.js'></\"+\"script>\")");

Mohd Shahid

unread,
Jun 17, 2019, 2:49:34 PM6/17/19
to Selenium Users
Hi Asotha,

If you solved this query. It will be a great help if you explain it to me. As I am working on the same Test case.

Waiting for your explanation.
Reply all
Reply to author
Forward
0 new messages