BSM 9.x – When creating a Downtime in BSM, it’s not possible to select various CIs, for example “SiteScope Monitor” or “SiteScope Group”

BSM 9.x – When creating a Downtime in BSM, it’s not possible to select various CIs, for example "SiteScope Monitor" or "SiteScope Group"

BSM 9.20

When creating a Downtime in BSM, it’s not possible to select various CIs, for example "SiteScope Monitor" or "SiteScope Group".

By default BSM doesn’t allow to enable downtime for all CITs.

When creating a downtime and getting to the CI Selection screen, simply click on Help,

and BSM will tell what CITs are allowed:

All views that the user has permission to see may be selected. You can select CIs only of the following CI types:

• node

• running software

• business application

• ci collection

• infrastructure service

• business service

"System Monitors" or "Sitescope Group" is not part of this list, thus you cannot select it.

This post has the instructions which explains how to select (for example) SiteScope Group CI for downtime scheduling.

It can easily adapted to enable any other CI for downtime scheduling.

Select SiteScope group CI to schedule downtime

  1. Please follow instructions below to select SiteScope group CI to schedule downtime

  1. Restart BSM
  2. Go to Downtime UI (Admin -> Platform -> Downtime Management)
  3. Verify that SiteScope group is not grey out (like a snapshot below)

  1. Go to Admin -> Platform -> Setup and Maintenance > Infrastructure Settings
  2. Find options “Object Root” and “Link Root” and change them to “root” (like on snapshot below)

  1. Re-login BSM
  2. Go to Admin -> RTSM Administration -> Modeling Studio (before editing, please backup TQL)
  3. Load “BSMDowntime_topology” and add “SiteScope Group” CI type to graph.

Then connect “BSMDowntime” with just added CIT with link “downtime of”

(this link become available after your changes in infra settings (see point 6)

  1. Double-click on “BSMDowntime” CIT and go to “Cardinality” tab.

You can see logical expression of node, your new added link between “SiteScope Group” and “BSMDowntime” will be mentioned with “AND” operand. You should switch it to “OR” (like on screenshot below)

  1. After these changes do not forget to save TQL

Display ALM tray icon after stopping installation of patch 1 for ALM 12.6

To restore the ALM tray icon:

  1. Cut and paste the conf folder from C:\ProgramData\Micro Focus\ALM to C:\ProgramData\HP\ALM.
  2. Edit <ALM Installation folder>\scripts\RunALMTrayIcon.bat. Modify the following:

    set InstallLocation=<ALM Installation folder>

    set TrayMain=com.hp.alm.platform.trayicon.ALMTrayIconMain

  3. Run the bat file.

Run time error “Server Error in ‘LoadTest’ Application.” when we click on test

Run time error “Server Error in ‘LoadTest’ Application.” is observed when we click on scenario both in My Performance Center and DesktoClient version 12.56 .

The full error message is:

Server Error in ‘/LoadTest’ Application.

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a “web.config” configuration file located in the root directory of the current web application. This <customErrors> tag should then have its “mode” attribute set to “Off”.

<!– Web.Config Configuration File –>

<configuration>
<system.web>
<customErrors mode=”Off”/>
</system.web>
</configuration>
image text
The test can be edited but in the summary tab the error message appears.

The issue is observed when analysis template and/or resource monitors which were deleted from the project are used it the problematic test.

To overcome the issue the missing analysis template and/or resource monitors should be removed from the test.

1. If the test is using a deleted analysis template the options are in the test to choose another analysis template or the default analysis template by following the steps below:

Click on a problematic test
Click on Edit test button
In test window select Advanced-> Analysis Template Options
In the Analysis Template Options select:
Use default Analysis Template
Click on OK
Save the test

2. If the test is using a deleted monitor the missing monitor need to be removed from to test or substituted it with an existing monitor.

To delete a Monitor please follow the steps below:

Click on Associated Monitors tab
Select the missing Monitor
Click on Remove Selected
To add an existing monitor

Click on Associated Monitors tab
Select “Add Monitor Profile” or “Add Monitor OFW”
Select the Monitor from Select Monitors part of the screen.

Tests fail due to low resolution using Lab Service (SSE) with auto-login feature

Automated tests failing, usually due to object not found in application under test

The ALM Lab Service, using the auto-login functionality, will establish a remote session on the host machine.

The native resolution of the session is determined by the video drivers used on the physical machine or virtual machine.

In some cases this causes a lower than normal screen resolution such as 800×600 which causes UFT to not locate the objects on the screen of the application under test.

To fix this upgrade and/or configure new video drivers on the physical box or VM which support the screen resolution established when the automated test was recorded using UFT.

Make sure the native resolution provided by the video drivers supports the same resolution when the test was recorded.

To set the resolution use: https://social.msdn.microsoft.com/Forums/azure/en-US/1c215514-aeef-41d9-b47b-5c838a0bf83f/how-to-change-the-vm-default-screen-resolution?forum=WAVirtualMachinesforWindows

How to upload Selenium tests to StormRunner Functional

SRF enables you to upload Web Selenium tests as SRF assets.

Upload your Selenium test

Before uploading a Selenium test to SRF, ensure that you first define the SRF server, port, client ID, and client secret in your test.

Then, do any of the following, as needed:

Applitools If you want to add Applitools visual testing steps to your test, see Add Applitools code to your Selenium script post.
Ruby If you are uploading a Ruby script to SRF, continue with Prepare a Ruby .zip for upload post.
Packaging multiple scripts To package multiple scripts together, continue with Prepare a Selenium .jar file for upload post.
JUnit tests If your script includes multiple tests in a single JUnit class, SRF runs all tests of the defined class.

If you do not want all of these tests to be run in SRF, comment out the relevant lines as needed before uploading.

When you’re done preparing your test, upload Selenium tests to SRF from the SRF SCRIPTS tab.

Prepare a Selenium .jar file for upload

Package your Selenium scripts as a .jar archive to upload to SRF.

Do the following:

1. Make sure you have the following prerequisites before you start:

Test script Ensure that your script can run remotely in SRF.

Note: We recommend making a copy of your original script in the same location for reference.

Maven Make sure you have Maven installed, and that your project is a maven project.
Descriptor file Add a descriptor.json file in your project’s resources folder.

In this file, define the runnableClass value as the path to the class you want to run, including the fully-qualified class name.

2. descriptor.json file with runnableClass example

2. In your Selenium script, replace your Client ID and Secret values with the following static code. You can comment out the CLIENT_ID property.

capabilities.setCapability("SRF_CLIENT_ID", System.getenv("SRF_CLIENT_ID"));
capabilities.setCapability("SRF_CLIENT_SECRET", System.getenv("SRF_CLIENT_SECRET"));

3. Add the RemoteWebDriver location as follows:

RemoteWebDriver driver = new RemoteWebDriver(new URL(System.getenv("SELENIUM_ADDRESS")), capabilities);

4. Compile your code, including any dependencies, and make sure the hierarchy remains stable.

Example: Compiling a .jar file with dependencies

5. From your IDE or the command line, run a maven clean install command.

Your compiled .jar file will be available for upload in your /target folder.

Continue with Basic upload steps to upload your .jar file to SRF.

Prepare a Ruby .zip for upload

To upload your Ruby test to SRF, you must first package the test as a .zip file.

Do the following:

· Include a Rakefile in your zip, including a default task that describes your test. SRF runs the default task when running your uploaded test.

The Rakefile filename is case-sensitive.

· Optionally, define parameters in your script to test different features in each test run.

For example, if you have a parameter named FEATURE_PATH, add the following code to your test:

t.cucumber_opts = '--format pretty ".\' + ENV["FEATURE_PATH"] + '"'

Then, continue with Basic upload steps to upload your .zip file to SRF.

Note: SRF supports specific frameworks out of the box. If your test requires additional components, they must be included in the zip file you upload.

For example, use the –install-dir flag of a gem command to install the component locally.

Selenium code samples for upload

Use the following code as samples when preparing Selenium tests for upload.

Selenium Java code sample

package com.microfocus.srf;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;

/** 
 * Micro Focus StormRunner Functional Selenium Java upload example
 */
public class SeleniumUpload
 {private static RemoteWebDriver driver;
 @BeforeClasspublic static void configToSRF()throws MalformedURLException{
 DesiredCapabilities capabilities = DesiredCapabilities.chrome();
 capabilities.setCapability("SRF_CLIENT_SECRET", System.getenv("SRF_CLIENT_SECRET"));
 capabilities.setCapability("name","My Uploaded Selenium Example");

 URL SRF_URL = new URL( System.getenv("SELENIUM_ADDRESS"));
 driver = new RemoteWebDriver(SRF_URL, capabilities);
 }

 @Testpublic void test() {
 driver.get("http://www.google.com");// Find the text input element by its name
 WebElement element = driver.findElement(By.name("q"));// Enter something to search for
 element.sendKeys("StormRunner Functional");// Now submit the form. WebDriver will find the form for us from the element
 element.submit();

 }

 @AfterClass
 public static void closeBrowser({
 driver.quit();
 }
}

Selenium JavaScript code sample

This example opens the Advantage Online Shopping site and performs a search. It then checks a price and adds an item to the cart, checks out and pays for the item. During payment phase, the example checks the total cost against the verified price.

This example also verifies specific parameter values as defined in SRF, or uses a defined set of default values.

var webdriver = require('selenium-webdriver'),
 By = webdriver.By,
 until = webdriver.until;
var assert = require('selenium-webdriver/testing/assert');

//This example specifies values for input parameters in SRF
//Parameter names should be as shown below

var categoryToFind = process.env.categoryToFind;
var itemToFind = process.env.itemToFind;
var expectedPrice = process.env.expectedPrice;
var driver;

//In case input parameters were not specified in SRF, default values will be used:
 if (categoryToFind==undefined)
 categoryToFind="speakers";
 if (itemToFind==undefined)
 itemToFind="Bose Soundlink Bluetooth Speaker III";

 if (expectedPrice==undefined)
 expectedPrice="$269.99";
describe('DEMO Online Shopping Selenium', function () {
 before(function(done){
 var capabilities = {
 browserName: 'chrome',
 SRF_CLIENT_ID: process.env.SRF_CLIENT_ID,
 SRF_CLIENT_SECRET: process.env.SRF_CLIENT_SECRET
 };
 driver = new webdriver
 .Builder()
 .withCapabilities(capabilities)
 .usingServer(process.env.SELENIUM_ADDRESS)
 .build();
 driver.get('http://advantageonlineshopping.com/#').then(function() {
 console.log("open Online Shopping web page");
 done();
 });
});

it('should search required category', function (done) {
 driver
 .wait(until.elementLocated(By.xpath("//DIV[@id="mobileSearch"]/INPUT[1]"), 5000))
 .then(function(searchFieldElement){
 searchFieldElement.sendKeys(categoryToFind);
 })
 .then(()=>driver.findElement(By.css("#mobileSearch > #Layer_1")).click())
 .then(done);
 });

it('should click on ' + itemToFind + ' in list of founded items', function (done) {
 var element = driver.findElement({partialLinkText:itemToFind, tagName:'LI'});
 driver
 .actions()
 .click(element)
 .perform();
 done();
});

it('should add item into the cart',function(done){
 driver
 .wait(until.elementLocated(By.xpath("//DIV[@id="productProperties"]/DIV/BUTTON[normalize-space()="ADD TO CART"]"), 5000))
 .then(function(){
 driver
 .findElement(By.xpath("//DIV[@id="productProperties"]/DIV/BUTTON[normalize-space()="ADD TO CART"]"))
 .click()
 .then(done);
 });
});

it('should click on cart icon',function(done){
 driver
 .findElement(By.xpath("//HEADER[1]/NAV[1]/UL[1]/LI[1]/A[1]"))
 .click()
 .then(done);
});

it('should check item price',function(done){
 var itemPrice = driver.findElement(By.css("div#shoppingCart > table > tfoot > tr:nth-child(1) > td:nth-child(2) > span:nth-child(2)"));
 itemPrice
 .getText()
 .then(function(elementText){
 assert(elementText).equals(expectedPrice);
 })
 .then(done);
 });

it('should click on checkout button',function(done){
 driver
 .findElement(By.xpath("//DIV[@id="shoppingCart"]/TABLE[1]/TFOOT[1]/TR[2]/TD[1]/BUTTON[1]"))
 .click()
 .then(done);
 });

it('should fill existing user details',function(done){
 driver
 .findElement(By.xpath("//DIV[@id="orderPayment"]/DIV[1]/DIV[1]/DIV[1]/SEC-FORM[1]/SEC-VIEW[1]/DIV[1]/LABEL[1]"))
 .click()
 .then(
 driver
 .findElement(By.xpath("//DIV[@id="orderPayment"]/DIV[1]/DIV[1]/DIV[1]/SEC-FORM[1]/SEC-VIEW[1]/DIV[1]/INPUT[1]"))
 .sendKeys('SRF_DEMO')
 .then(
 driver
 .findElement(By.xpath("//DIV[@id="orderPayment"]/DIV[1]/DIV[1]/DIV[1]/SEC-FORM[1]/SEC-VIEW[2]/DIV[1]/LABEL[1]"))
 .click()
 .then(
 driver
 .findElement(By.xpath("//DIV[@id="orderPayment"]/DIV[1]/DIV[1]/DIV[1]/SEC-FORM[1]/SEC-VIEW[2]/DIV[1]/INPUT[1]"))
 .sendKeys('SRFdemo1234')
 .then(done)
 )));
});

it('should click login button',function(done){
 driver
 .findElement(By.xpath("//DIV[@id="orderPayment"]/DIV[1]/DIV[1]/DIV[1]/SEC-FORM[1]/SEC-SENDER[1]/A[1]"))
 .click()
 .then(done);
 });

it('should check total price',function(done){
 var totalPrice = driver.findElement(By.css("div#userCart > div:nth-child(5) > label:nth-child(2) > span"));
 totalPrice
 .getText()
 .then(function(elementText){
 assert(elementText).equals(expectedPrice);
})
 .then(done);
});

it('should click next button',function(done){
 driver
 .findElement(By.xpath("//DIV[@id="userSection"]/DIV/DIV/BUTTON[normalize-space()="NEXT"]"))
 .click()
 .then(done);
 });

it('should specify user details for buying items',function(done){

 driver
 .findElement(By.xpath("//DIV/SEC-FORM/SEC-VIEW/DIV/LABEL[normalize-space()="SafePay username"]"))
 .click()
 .then(
 driver
 .findElement(By.css("div#paymentMethod > div > div:nth-child(3) > sec-form > sec-view:nth-child(1) > div > input"))
 .sendKeys('testTest')
 .then(
 driver
 .findElement(By.xpath("//DIV/SEC-FORM/SEC-VIEW/DIV/LABEL[normalize-space()="SafePay password"]"))
 .click()
 .then(
 driver
 .findElement(By.css("div#paymentMethod > div > div:nth-child(3) > sec-form > sec-view:nth-child(2) > div > input"))
 .sendKeys('testTEST1234')
 .then(done)
 )));
});

it('should uncheck checkbox "save cahnges to profile"',function(done){
 driver
 .findElement(By.xpath("//DIV[2]/SEC-FORM[1]/DIV[1]/INPUT[1]"))
 .isSelected()
 .then(function(elementSelectedState){
 if (elementSelectedState)
 driver
 .findElement(By.xpath("//DIV[2]/SEC-FORM[1]/DIV[1]/INPUT[1]"))
 .click()
 .then(done);
 });
 });

it('should click on "Pay now" button',function(done){
 driver
 .findElement(By.xpath("//DIV[2]/SEC-FORM[1]/DIV[2]/LABEL[1]/SEC-SENDER[1]/A[1]"))
 .click()
 .then(done);
 });

 it('should check price in order details',function(done){

 var totalPrice = driver.findElement(By.css("div#orderPaymentSuccess > div > div:nth-child(3) > div:nth-child(4) > label > a"));
 totalPrice
 .getText()
 .then(function(elementText){
 assert(elementText).equals(expectedPrice);
 })
 .then(done);
 });

 after(function(done){
 driver.quit().then(done);
 });
});

Sample Ruby .zip file

The following is an example of the contents of a zip file containing a Ruby test ready for upload:

The files in this example include the following code:

your.feature file

In this example, the your.feature file includes a cucumber test:

Feature: Bing can search
Background:
 Given I am on http://bing.com
Scenario: Search for a term
 Then I will search for "SRF"
 And click the MagnifyGlass
 Then I should see "SRF"

steps.rb file

In this example, the steps.rb file contains the step definitions for the cucumber test:

require "capybara/cucumber"
Given /^I am on (.+)$/ do |url|
 visit (url)
end
Then /^I will search for "(.*?)"$/ do |searchText|
 fill_in 'q', :with => searchText
end
And /^click the MagnifyGlass$/ do
 find(:css,'input[type=submit]').click
end
Then /^I should see "(.*?)"$/ do |searchText|
 expect(page).to have_content(searchText)
end

Rakefile file

In this example, the Rakefile contains a default task, which is executed by SRF when running your test.

require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:default) do |t|
 t.cucumber_opts = '--format pretty ".\features\your.feature"'
end

How to Upload UFT tests to StormRunner Functional

Upload a Web or Mobile test from UFT to SRF to use it in modular automation tests in the cloud.

Upload tests from UFT

If you already have the test opened in UFT, or the test is conveniently accessible from UFT, use the SRFbutton in the UFT toolbar to upload your test.

1. Verify that you have a valid connection to the SRF lab.

Connect to SRF

2. In the UFT toolbar, click the Upload to StormRunner Functional button arrow.

Select one of the following:

Upload From File System Drag and drop the test in the upload box, or browse to the test you want to upload.
Upload Active Test Select to upload the test that’s currently active in UFT.

3. Optionally, enter a new name for your test in SRF.

4. Select your test type:

o Select Mobile only if you are testing mobile apps on mobile devices.

o Select Web if you are testing browsers, whether they are mobile or desktop browsers.

Note: Cross browser testing defined by browser parameters in UFT is ignored by SRF.

Define your testing environment in SRF before running your test.

5. Click Upload. Your test is zipped, together with any relevant external resources, and uploaded to SRF.

When the upload is complete, UFT displays a link to the test in SRF. Your test remains open in UFT.

Data tables in uploaded tests

Content in data tables in uploaded UFT tests ignored, although the rows are kept, and use values defined in SRF.

For example, if your data table includes rows for Chrome and Android, the values in the data table are ignored, but the test is run in two iterations for the environments defined in SRF.

Upload tests from SRF

Upload UFT tests from within SRF from the SCRIPTS page.