userjourney issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
njain213

userjourney issue

Post by njain213 »

Hi Team,

Using Selenium IDE i have done recording and a script is generated but when I have executed that script below issue is coming.

Code: Select all

[root@centos65 libexec]# perl imrtst
ok 1 - set_timeout, 120000
ok 2 - open, /worksitemp/index.jsp
ok 3 - type, name=UserId, <username>
ok 4 - type, name=Password, <password>
ok 5 - click, id=login
ok 6 - wait_for_page_to_load, 120000
# Error requesting http://10.72.27.127:4444/selenium-server/driver/:
# ERROR: Window does not exist. If this looks like a Selenium bug, make sure to read http://seleniumhq.org/docs/02_selenium_ide.html#alerts-popups-and-multiple-windows for potential workarounds.
not ok 7 - select_window, name=wsmpTop
#   Failed test 'select_window, name=wsmpTop'
#   at imrtst line 19.
Location: https://<URL>/worksitemp/dispatch?operation=zoom&datasource=homePage
1..7
# Looks like you failed 1 test of 7.



Script that was generated is as below:

Code: Select all

use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
use TimePerf2;

my $time= TimePerf2->new(60,90,120);


my $sel = Test::WWW::Selenium->new( host => "10.72.27.127", 
                                    port => 4444, 
                                    browser => "*chrome", 
                                    browser_url => "https://<URL>/" );

$time->startTime("ALL");
$sel->set_timeout_ok("120000");
if ( !  $sel->open_ok("/worksitemp/index.jsp") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->set_speed("1500") ) { }

elsif ( !  $sel->type_ok("name=UserId", "<username>") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->type_ok("name=Password", "<password>") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=login") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {} 
elsif ( !  $sel->select_window_ok("name=wsmpTop") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->type_ok("name=umrPolicy", "b0001") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->select_window_ok("name=wsmpTop") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=searchFormPolicyFirefox") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {} 
elsif ( !  $sel->select_window_ok("name=wsmpTop") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("link=B000100000UMR") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {} 
elsif ( !  $sel->select_window_ok("name=wsmpTop") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("link=Log Off - XIS Administrator") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=Cancel") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {} 
elsif ( !$time->endTime("ALL") ) { }

else { $time->getTimes(); }
$sel->stop();

Could you please help me insolving this issue.

Regards,
Naman
Last edited by njain213 on Wed Feb 01, 2017 1:20 am, edited 1 time in total.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: userjourney issue

Post by mcapra »

We usually can't offer advice on troubleshooting individual Selenium test cases. As long as the test executes correctly and returns the proper status data to Nagios, that's roughly the end of what we can support.

You'll have to observe the test case (the Perl test case, not the raw test case run from the IDE) running in a live browser and see what it's trying to do when it fails. A step of your test is failing, though it's impossible to say why without knowing the complete structure of the page that is being tested.
Former Nagios employee
https://www.mcapra.com/
njain213

Re: userjourney issue

Post by njain213 »

Hi team,

This issue needs to resolve asap because I have to give demo to management and if this issue will resolve then we are going to purchase the license of using Nagios.

Please help and let me know what information you required from side.

Regards,
Naman
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: userjourney issue

Post by mcapra »

This still stands:
mcapra wrote:A step of your test is failing, though it's impossible to say why without knowing the complete structure of the page that is being tested.
Selenium has lots of quirks and tricks when it comes to writing good test cases. My hunch is that there is no window named wsmpTop when Selenium reaches this step (line 29 I believe), or the IDE incorrectly pulled the window name. The IDE is imperfect; It's included in our documentation because it's fairly easy to operate and can work for many simple test cases, but it is imperfect.

This is pretty out of scope for what we normally offer support-wise. I would investigate specifically why Selenium is unable to find a window named wsmpTop. Perhaps the Window never really changes so you don't need to "re-select" it, but one would have no way of knowing without intimate knowledge of the page/application's structure.
Former Nagios employee
https://www.mcapra.com/
njain213

Re: userjourney issue

Post by njain213 »

Thanks for the update but as you are providing integration feature to us and if we want to purchase licence from you so we would expect that you should help in this and if this issue will not be solved then I am afraid we should stop thinking to purchase nagios license and go for another tool.

Again I got same issue on another application.

Please find below error for the same.

Code: Select all

root@centos65 libexec]# perl filenet 
ok 1 - set_timeout, 120000
ok 2 - open, /navigator/?desktop=imr
# Error requesting http://10.72.27.211:4444/selenium-server/driver/:
# ERROR: Element id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername not found
not ok 3 - type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr
#   Failed test 'type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr'
#   at filenet line 19.
Location: https://fn.repositorytsb.xchanging.com/navigator/?desktop=imr
1..3
# Looks like you failed 1 test of 3.
[root@centos65 libexec]# perl filenet 
ok 1 - set_timeout, 120000
ok 2 - open, /navigator/?desktop=imr
# Error requesting http://10.72.27.211:4444/selenium-server/driver/:
# ERROR: Element id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername not found
not ok 3 - type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr
#   Failed test 'type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr'
#   at filenet line 19.
Location: https://fn.repositorytsb.xchanging.com/navigator/?desktop=imr
1..3
# Looks like you failed 1 test of 3.
Please find below script that generated using selenium IDE.

Code: Select all

use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
use TimePerf2;

my $time= TimePerf2->new(60,90,120);


my $sel = Test::WWW::Selenium->new( host => "<IP address>", 
                                    port => 4444, 
                                    browser => "*chrome", 
                                    browser_url => "<URL>/" );

$time->startTime("ALL");
$sel->set_timeout_ok("120000");
if ( !  $sel->open_ok("/navigator/?desktop=imr") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->set_speed("1500") ) { }

elsif ( !  $sel->type_ok("id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername", "<username>") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->type_ok("id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername2", "<userID>") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_password") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->type_ok("id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_password", "<password>") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("xpath=(//input[\@value=''])[8]") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_LoginButton_label") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("css=input.dijitOffScreen") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=dijit_MenuItem_3_text") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("xpath=(//input[\@value=''])[33]") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !  $sel->click_ok("id=dijit_form_Button_17_label") ) {print "Location: " . $sel->get_location() . "\n";}

elsif ( !$time->endTime("ALL") ) { }

else { $time->getTimes(); }
$sel->stop();


Also please find below content that you have asked and also attached doc for the same.

Code: Select all

<!DOCTYPE html>


<html lang="en-us" dir="ltr">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       
    <meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"/>
    
    <link rel="shortcut icon" href="ecm/widget/resources/images/favicon.png"/>
    <style>
        @import "ecm/widget/resources/dojo.css.jgz";
        @import "ecm/themes/oneui/dojo.css.jgz";
        @import "ecm/widget/resources/ecm.css.jgz";
        @import "ecm/themes/oneui/oneui.css.jgz";
 		@import "pvd/themes/pvd.css.jgz";
		@import "pvr/themes/pvr.css.jgz";
		@import "ecm/widget/viewer/crocodoc/viewer_min.css";
	   	.loadingText { text-align: center; }
    	
    </style>      

    <script src="dojo/dojo.js.jgz" data-dojo-config="locale: 'en-us', extraLocale: ['en'], parseOnLoad: true, has: {'dojo-bidi': false, 'text-direction': '', 'calendar-type': ''}, isDebug: false,aliases: [['dijit/BackgroundIframe', 'ecm/BackgroundIframe']],packages: [{name: 'idx', location: '../idx'}]"></script>
    <script src="ecm/ecm.js.jgz"></script>
    <script>
        dojo.require("ecm.Logger");
        ecm.logger.initLogger(0,false);
        require(["dojo/domReady!", "dojo/dom"], function(domReady, dom){
			
    		var node = dom.byId("ECMWebUIloadingText");
			if(node){
				var loadingMsg = "";
				if (navigator.appVersion.indexOf("MSIE 8") > 0) {
					var image = dom.byId("ECMWebUIloadingAnimationImage");
					if (image && image.style) {
						image.style.display = "none";
					}
					if (ecm && ecm.messages && ecm.messages.ie8_not_supported_browser) {
						loadingMsg = ecm.messages.ie8_not_supported_browser;
					} else {
						loadingMsg = "IE8 is not a supported browser.";
					}
				} else {
					if (ecm && ecm.messages) {
						loadingMsg = ecm.messages.progress_message_getDesktop;
					} else {
						loadingMsg = "An error occurred when the browser attempted to load the ecm.js.jgz file from the application server.<br>The ecm.js.jgz file is required by IBM Content Navigator.<br><br>Please contact your system administrator and ask them to check the network or application server environment.";
						node.style.textAlign = "left";
						var loadingAnimation = dom.byId("ECMWebUIloadingAnimationImage");
						if (loadingAnimation) {
							loadingAnimation.style.display = "none";
						}
					}
				}
				node.innerHTML = loadingMsg;
			}
		});
    </script>
</head>


<body class="ecm oneui ecm-en" style="width: 100%; height: 100%; position: absolute;">
	<script type="dojo/require">at: "dojox/mvc/at"</script>
	
		<div id="ECMWebUIloadingAnimation">
		  <div style="position: absolute; top: 40%; right: 50%">
			<div id="ECMWebUIloadingAnimationImage" class="ecmLoading"></div>
			<div id="ECMWebUIloadingText" class="contentNode loadingText"></div>
		  </div>
		</div>
	
	<div dojoType="ecm.widget.DesktopPane" id="ECMWebUI" style="width: 100%; height: 100%" browserLocale="en-us"></div>
</body>

</html>


Please let me know in case you require anything else from my side.

Regards,
Naman
You do not have the required permissions to view the files attached to this post.
Last edited by tmcdonald on Wed Feb 01, 2017 10:55 am, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: userjourney issue

Post by mcapra »

Like I said, the Selenium IDE is imperfect. We recommend it in our documentation because it's accessible for people without a background in QA testing or programming, but at it's core it is imperfect. It doesn't always handle AJAX calls manipulating the DOM, ActiveX/Java apps, certain situations with iframes, etc.

Based on the test case as well as the provided HTML, the test case appears to be doing it's job.

Code: Select all

# Error requesting http://10.72.27.211:4444/selenium-server/driver/:
# ERROR: Element id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername not found
not ok 3 - type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr
#   Failed test 'type, id=nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername, bkr'
#   at filenet line 19.
This is saying that the driver can't find an element matching the provided value for id. Looking over the DOM you posted, I can't find any element with the id nativeRepositoryPluginDojo_IMRLayout_0_LoginPane_XCusername. This means (i'm assuming a lot here) that when Selenium tries to send <username> to the "username" field, it can't find the username field. Without knowing approximately everything there is to know about the application you are trying to write the test for, it's hard to offer specific advice.
Former Nagios employee
https://www.mcapra.com/
njain213

Re: userjourney issue

Post by njain213 »

Thanks for the response.

Could you please let me know what do you want to know about the application?I will provide all the details.

Regards,
Naman
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: userjourney issue

Post by rkennedy »

I believe the issue at hand as @mcapra has pointed out, is with the Selenium test case itself. Once it is written fully, then Nagios will be able to execute it as expected. Selenium isn't our product so we're really limited on the support we can provide here.

We can however, help with the Nagios portion of things.
Former Nagios Employee
njain213

Re: userjourney issue

Post by njain213 »

I know Selenium isn't your product but you are providing us this feature that is why we are thinking of purchasing it and it is our main requirement before purchasing license so could you please consult any expect.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: userjourney issue

Post by tmcdonald »

You are welcome to sign up for a Quickstart session during which we can attempt to fix the Selenium script: https://www.nagios.com/services/quickstart/

But as others have pointed out, this is not in-scope of our support. The feature we are providing is the ability to run a Selenium script which is already functioning. We do not support the writing of the script itself, only the running and interpretation of the results. This is true with all plugins - we support the integration, but it is up to the plugin author to get it working.
Former Nagios employee
Locked