Question
Atos
IN
Last activity: 17 Nov 2023 1:15 EST
Selenium Starter Kit Not instantiating Browser object
I am working on Pega project where we want to achieve test automation using Selenium tool, for this we are using framework provided by Pega community (Version 4.0.0 (CRM Test Framework)). However while using this framework I am getting errors as attached in text file.
Due to this the browser object is created but no further steps working.
I tried adding capabilities (--remote-allow-origins=*) from global properties file but it did not worked and returned message in Console as Invalid capabilities.
Kindly please do let me know how can I resolve it.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 4 Dec 2023 9:27 EST
Pegasystems Inc.
IN
@MarijeSchillern @VrushalI16876534 The capabilities that need to be added to global properties file is chrome.options.arguments=--remote-allow-origins=*;ignore-certificate-errors .
Pegasystems Inc.
GB
@VrushalI16876534 as it is a Pega Marketplace software, did you try to contact the Product Owner listed on the marketplace page Tejesh Kumar Reddy Nagireddy?
@nagit can you help answer this question?
Accepted Solution
Updated: 4 Dec 2023 9:27 EST
Pegasystems Inc.
IN
@MarijeSchillern @VrushalI16876534 The capabilities that need to be added to global properties file is chrome.options.arguments=--remote-allow-origins=*;ignore-certificate-errors .
Updated: 2 Nov 2023 11:15 EDT
enigma metaverse
IN
@MarijeSchillern Hello, is there any setup guide or tutorial on how to use this framework to automate any of our pega applications from scratch? like how to create any sample test cases or how to extend framework. thanks in advance.
@somis2 please can you answer this question?
enigma metaverse
IN
@VrushalI16876534
Hi Vrushall , i think i'm also facing a issue similar to this, is there any way to connect with you to resolve this issue?
Pegasystems Inc.
IN
@sateeshk16966153 The capabilities that should be added to global settings file are chrome.options.arguments=--remote-allow-origins=*;ignore-certificate-errors.
And the documentation to extend Selenium Starter Kit Framework can be found at https://community.pega.com/media/selenium-starter-kit-developers-guide-extending-base-frameworkv400
You can find the link in Selenium Starter Kit home page as well.
Kindly let us know if you have more queries
enigma metaverse
IN
we are working on Pega project where we want to achieve test automation using Selenium tool, for this we are using framework provided by Pega community (Version 4.0.0 (CRM Test Framework)). However while using this framework we are getting errors as attached. this attached image consists of error when launching the runner class, below is the code snippet for app environment to intiate the browser.
we are working on Pega project where we want to achieve test automation using Selenium tool, for this we are using framework provided by Pega community (Version 4.0.0 (CRM Test Framework)). However while using this framework we are getting errors as attached. this attached image consists of error when launching the runner class, below is the code snippet for app environment to intiate the browser.
package com.pega.CS_sampleframework;
import com.google.inject.Inject;
import com.pega.Browser;
import com.pega.config.test.TestBase;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import io.cucumber.guice.ScenarioScoped;
import io.cucumber.java.Scenario;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
@ScenarioScoped
public class MyCSTestEnvironment extends TestBase {
String COPYRIGHT = "Copyright (c) 2023 Pegasystems Inc.";
String VERSION = "$Id: MyCSTestEnvironment.java 2023-10-18 02:21:49Z satheesh $";
private Browser browser;
private Scenario scenario;
@Override
@Inject
public Browser getBrowser() {
if (browser==null) {
browser = new MyCS_browser(this);
}
return browser;
}
@Before
public void setUp(Scenario scenario) {
this.scenario = scenario; //this object of scenario is to send to localizationUtil to take screenshot of every step failure
System.setProperty("is.one.step.one.def", "true");
setUp(scenario, null);
}
protected void setUp(Scenario scenario, String browserName) {
initializeStatus();
startRecording(scenario);
configureBrowser();
}
@After
public void tearDown(Scenario scenario) {
tearDown(scenario, true, alwaysSaveVideo);
}
public Scenario getScenario()
{
return scenario;
}
}
in the junit test im using this below code to launch but, its giving me intialization errors and null pointer exception, please let me know the solution to this, i tried everything in setup guide for extending the framework(https://community.pega.com/media/selenium-starter-kit-developers-guide-extending-base-frameworkv400)
enigma metaverse
IN
@somis2@nagit Hi, Kindly help me with the below issue
we wanted to use selenium starter kit available in Pega community for automation testing of our pega applications. we have extended the project using the setup guides available in the website. While running the testcases, browser is opening with url provided in the data sheet but its failing to complete the login operation. (getcredential method failing). exact error message in the eclipse console is " java.lang.NullPointerException: Cannot invoke "com.pega.Configuration.getCredential(String)" because "this.configuration" is null".
Please help me with the errors, thanks in advance. i have attached the error screenshots and respective java classes responsible for the operation in below zip file. Thanks in advance.
Pegasystems Inc.
GB
@sateeshk16966153 according to the Marketplace product summary you can contact the Selenium Team product owners on an email address:
Please contact them on: [email protected]
enigma metaverse
IN
@MarijeSchillern Hello Marije, I'm unable to contact ([email protected]) since its an external org, I'm getting typical reply from [email protected] as it was out of organization, the error message was "When Office 365 tried to send your message, the receiving email server outside Office 365 reported an error."
Kindly let me know how to connect with the support team to solve my issue, thanks in advance.
Pegasystems Inc.
IN
@sateeshk16966153 Hi Satheesh, can you please send the browser and portal class created? 7th page https://community.pega.com/media/selenium-starter-kit-developers-guide-extending-base-frameworkv400 explains how to create browser and portal class.
enigma metaverse
IN
@somis2 Hello Swapnika,
I did changes in the step definition file and now i'm able to open browser with given url and successfully login into my pega application. and to further develop the testcase.
I stored all the objects in a class in com.workobjects class. I'm trying to use the existing methods in workobjects class in my step definition file. but the methods are not working in stepdef file, kindly let me know the changes that needed to be done in my step definition file or my workobjects class.
i'll include both my step def class and work object class, thanks in advance.
enigma metaverse
IN
@sateeshk16966153 @somis2 Hello Team, still waiting for your reply on this, i attached my appbrowser class in the attachment section thanks in advance.
enigma metaverse
IN
@sateeshk16966153 @somis2 Another issue related to selenium identifying web objects inside of frame in pega app
in our pega project, to achieve end to end test automation, we have decided to use pega selenium starter kit to achieve test automation. everything is working fine.
but facing issues while accessing buttons inside of a frame in our Pega application. we can access the text boxes and enter data in those text fields also, but while accessing buttons in the page, selenium is not detecting the same
we included in code to enter frames also like this pegadriver.switchto().frame(frameid).
control is going to respective frame but cant access the buttons only while one text box is getting located by selenium inside of the same frame, the locators used are correct, we verified in dom. we checked with different locators and still cant access the buttons inside the frame. the issue is there with the buttons in other frames also while other webelements like text box, links are working good.
kindly let us know the solution, thanks in advance. please refer code snippet for the issue below..
for webelement button (not working) in same iframe
pegaDriver.switchTo().frame("PegaGadget1Ifr");
PegaWebElement conclude_button = pegaDriver.findElement(By.xpath("//button[@class='Wrap_up_button pzhc pzbutton']"));
conclude_button .click();
@sateeshk16966153 @somis2 Another issue related to selenium identifying web objects inside of frame in pega app
in our pega project, to achieve end to end test automation, we have decided to use pega selenium starter kit to achieve test automation. everything is working fine.
but facing issues while accessing buttons inside of a frame in our Pega application. we can access the text boxes and enter data in those text fields also, but while accessing buttons in the page, selenium is not detecting the same
we included in code to enter frames also like this pegadriver.switchto().frame(frameid).
control is going to respective frame but cant access the buttons only while one text box is getting located by selenium inside of the same frame, the locators used are correct, we verified in dom. we checked with different locators and still cant access the buttons inside the frame. the issue is there with the buttons in other frames also while other webelements like text box, links are working good.
kindly let us know the solution, thanks in advance. please refer code snippet for the issue below..
for webelement button (not working) in same iframe
pegaDriver.switchTo().frame("PegaGadget1Ifr");
PegaWebElement conclude_button = pegaDriver.findElement(By.xpath("//button[@class='Wrap_up_button pzhc pzbutton']"));
conclude_button .click();
for webelement text box(working fine) in same iframe
pegaDriver.switchTo().frame("PegaGadget1Ifr");
PegaWebElement search_field = pegaDriver.findElement(By.xpath("//input[@id='a3b3c2bf']"));
search_field.click();
pegaDriver.switchTo().frame("PegaGadget1Ifr");
search_field.sendKeys(" customer name");
Pegasystems Inc.
IN
@sateeshk16966153 Hi Sateesh, Following could be the possible reasons for the script unable to identify the button
1. The element (Button) can be hidden in the Frame. If this is the case, you can depend on the style attribute of the button to identify the element.
2. There can be multiple elements being identified with the mentioned XPATH. you can verify this in console tab using java script functions like document.queryselector etc. - If this is the case, you should have XPATH to uniquely identify the element (button).
Should you have any more queries, kindly let us know.
Thank you,
Swapnika