846 questions
0
votes
0
answers
15
views
Why my select elements not showing up in my stepdef class?
So I am trying to validate the facebook create account page as a practice. I captured the elements for first name, last name, email address, password, and gender. Then I captured the dropdown menu for ...
0
votes
1
answer
142
views
How to abstract web elements and actions in page object model (Selenium+python)?
I have Options table with ON/OFF option (checkboxes, radio buttons and text fields). The table has 30 rows. I stored locators as ENUM
class OptionType(Enum):
PAYMENT_TYPE_CREDIT_CARD = "...
0
votes
2
answers
115
views
Error making method call inside cypress orgin command
I'm getting the following error attempting to automate my login procedure into a page object.
this.signIn is not a function
Here is my page object:
export class OktaLoginPage {
oktaServer = Cypress....
-2
votes
1
answer
390
views
Selenium WebDriver PageFactory Webelement initialization
I have more than 500 web-elements in a webpage. If I use Page Object Model with PageFactory.initElements() in selenium it will initialize all the elements once the object is created.
Lets says I am ...
0
votes
2
answers
382
views
TS playwright. Unable to re-use authentication when using POM
Im new to Playwright, but I know that we can re-use the authencation with Playwright. However, when I approach the test with POM, it seems like I could not use it. Could anyone able to help me with ...
1
vote
1
answer
273
views
Cypress page object model pattern. Extending the elements property
I have the following page object model representing a widget in my app
/**
* Contains common actions for all widgets
*/
export default abstract class AbstractWidget {
private widgetId: number;
...
0
votes
0
answers
199
views
Automated test runs correctly locally, but fails in jenkins
I created a simple Page Object style test that automates testing for language changes on a site. Locally the test runs correctly, but when running in jenkins an error occurs.
I have attached a ...
0
votes
1
answer
84
views
How can I run Same Test Case Multiple Times with Different Set of Data using TestNG + Selenium WebDriver
I have one utility class as DataManager.java where I have written a method to read data from an excel sheet.
public static XSSFWorkbook xssfWorkbook;
public static XSSFSheet xssfSheet;
public static ...
0
votes
1
answer
889
views
Playwright/TypeScript calling Parent function on Child class
So i've ran into a super strange issue that while i've fixed im not exactly sure why this is happening:
I have a base page object that all other page objects inherit from. It's pretty simple and looks ...
0
votes
0
answers
91
views
Page factory model Selenium Java - WebElement List returns empty list whereas Page object returns size
Page object model and using driver.find elements
int noOfLinks = driver.findElements(By.xpath("//p[@class='_78mc9p']")).size();
System.out.println(noOfLinks);
Prints the size as &...
0
votes
1
answer
733
views
Can we call one test case from the another test case in Cypress?
I am doing automation testing using Cypress with JavaScript.
I have to manage a test case for add, search and edit user. I have created a different test case for each. After adding user, I verified ...
0
votes
1
answer
3k
views
How to Test Scroll Behavior When Scrollbar Doesn't Exist with Playwright?
I'm currently working on automated tests with the page object using Playwright, and I have a function scrollDownAndUpOnboarding that's designed to scroll down and then up on a web page. However, I've ...
0
votes
0
answers
37
views
NullPointerException :
I wanted to try and implement Page Object Model in my code. The first page would be responsible for opening url, and giving username and password.
Currently my code opens the url and loads the webpage ...
1
vote
1
answer
805
views
JavaScript class vs function returning object
So im pretty much used to always using classes when writing automation code (Using the Page object Model). However i've came across some PoM/Component sample code that im not really used to seeing. ...
0
votes
1
answer
185
views
How to have a reusable method that find all the webelements using WebElement type parameter in page factory model
I have an automation framework that is driven using page object model using page factory
@FindBy(xpath = "xpathValue")
private WebElement notificationIcon;
I want to have an reusable ...
1
vote
1
answer
47
views
TypeError: 'str' object is not callable selenium -
Here is a small test carried out with selenium in python:
locators = {
"entreprise_selection": ("ID", 'uidropdownCompanies'),
"entreprise_load": ("...
0
votes
1
answer
1k
views
Selenium POM - "this.driver" is null
I am learning about POM Selenium + Java. I want to refactor class for tests. Right now I have one class but I want divide code into two class: one class will be for initializing browser with ...
1
vote
1
answer
230
views
Page object decomposition into smaller reusable components
I currently work on UI-level e2e test automation of a web app, where entire flow is concentrated in one page. To avoid huge single page object size, I've split it into smaller components, listed out ...
0
votes
1
answer
536
views
Page Object Manager in Cucumber-js with Typescript
I am writing Playwright Cucumber TypeScript framework (stack must be like this, even though we don't do BDD at all).
I created POManager to manage all Page Object classes (what do you think about this ...
0
votes
1
answer
244
views
What is the best approach to Page Object Model for UI automation
When designing an automation framework, should i start by populating page object models with all of the elements in my application or only the elements that are being used within exsisting test ...
1
vote
2
answers
4k
views
Re-Creating Page Objects in Playwright?
In Playwright (Like many other automation frameworks) you can create page objects. Using an example from Playwrights documentation: https://playwright.dev/docs/test-fixtures#without-fixtures
You have ...
0
votes
2
answers
114
views
Cypress.io - How do I wait for the result of a method that returns an invoked attribute?
I have a method that gets the href-attribute of an element hrefAppTheme and checks if its one of the values of the string-array appThemes:
describe('...',() => {
it('should ...', () => {
...
0
votes
2
answers
381
views
calling variables from different commands in cypress page object modal tests
I am using Cypress with page object model in my project.
I have 2 commands in homepage.js :
One to get custId from header section & the other to get custId on footer of the page.
Now I need to ...
0
votes
1
answer
191
views
How to work with the web elements that are common in multiple web pages in selenium page object model?
I have many webelements that are same for every web page. Should I create a new page class for including all the common web elements?
0
votes
1
answer
4k
views
NullPointerException Cannot invoke "org.openqa.selenium.SearchContext.findElement(org.openqa.selenium.By)" because "this.searchContext" is null
I am encountering a java.lang.NullPointerException error when trying to run my Selenium test with TestNG. The error message states: Cannot invoke "org.openqa.selenium.SearchContext.findElement(...
2
votes
4
answers
3k
views
Get CSS string value from locator page object in MS Playwright
Lets say I have a class containing page objects. If I instantiate that class in a test, then I can use the page objects as you normally would with playwright. I would like to get the css value as a ...
3
votes
1
answer
1k
views
How can I avoid multiple awaits when queueing async methods in typescript/playwright
Currently I am writing a small test project for which I use the Page Object Model and Playwright. I have pages with methods returning either the page itself or another page. This makes it easier for ...
0
votes
0
answers
120
views
Cypress typescript module can't recognise a module
I'm trying to implement a page object pattern in a project that i cloned. The problem is that when i try to import a module, I get an error from VScode ='File '../path/module' is not a module.' I ...
0
votes
1
answer
709
views
How to iterate through Page Object selectors declared in the constructor (Playwright)
I've got a web page, where I have defined numbers of filters. Chosing value for a single filter immediately affects shown results. I'm trying to define a function that will iterate through each filter,...
0
votes
1
answer
823
views
URL assertion failing in playwright while implementing Page Object model
I am trying to implement POM in playwright, I have created a class in which I am trying to click two buttons to navigate to a page and then apply URL assertion to check the expected URL. But the URL ...
1
vote
1
answer
689
views
How can I pass a variable to the element found using Appium @FindBy
Is there a way to dynamically set the xpath or id used by Appium @FindBy() so I dont have to create a dozen individual WebElements?
I am using the Page Object Model to automate a mobile app. I use to ...
1
vote
1
answer
257
views
Function implementation showing type error in Cypress while running tests
I am working on cypress for web application automation and having an issue with accessing a function from an object.
The code below is from a javascript file in 'e2e' folder.
class productsDemo {
...
0
votes
1
answer
145
views
Automation test fails due to login problem
I writing an e2e test automation for some application that requiere also a log in test.
BeaforeEach test i perform the login test, at the first it block the test passes
But at the second it block, ...
0
votes
0
answers
51
views
How to select particular action button for particular data which contains particular text
I have total for ex. 5 properties and action button for every property as shown in the picture. Each property has a status either manual or post. I need to find the property which has 'manual' status ...
1
vote
2
answers
3k
views
Is there way to a find child element from existing element in Selenium with Java?
Say, there are multiple elements and their and multiple child elements. I have selected the parent elements and from the code the I want to select the child elements.
<html>
<body>
<div&...
0
votes
0
answers
279
views
Page Object pattern alternative for statically typed languages (e.g.: Java, C#)
I have to build test automation for a web project. I will use Java language and Selenium WebDriver. Before I usually used the Page Object pattern and didn't see anyone else using a different pattern. ...
1
vote
2
answers
164
views
How to pass PageObject for cucumber step definition
I see the following step in noraUI sources
@And("I expect to have {page-element} with the text {string}(\\?)")
public void expectText(Page.PageElement pageElement, String textOrKey, List<...
1
vote
1
answer
728
views
Cypress return value in class method
I am trying to apply the Page Object Model (POM) to some tests using Cypress.
Unfortunaly I can't read some webelement value and return it as a method or function value. I needed to make something ...
0
votes
2
answers
3k
views
Playwright - Javascript - Page Object - TypeError: page.$(...).toBeVisible is not a function
good morning. I'm facing the next issue below:
TypeError: page.$(...).toBeVisible is not a function
The line in question --> await expect(await page.$(homeIcon()).toBeVisible())
This is the login-...
1
vote
0
answers
204
views
re-use new page object for each test
So I am using playwright/test with Typescript
I have a testapp.ts setup which contains all my methods eg for logging in, navigating etc
Inside my test example.spec.ts each test looks like this:
...
0
votes
2
answers
2k
views
How to handle new tabs with the page object model with Playwright
I want to know how to handle a tab or multiple tabs when using Page object model.
My test runs successfully if i don't use the page object model function to run it.
Basically when i click and navigate ...
0
votes
1
answer
531
views
Page objects not being run in webdriverio setup
I've created a test script in webdriverio (version 6.14.13) and mocha, which uses the page object functionality.
This is because some of my test script is used in the vast majority of my other scripts,...
0
votes
1
answer
176
views
How to set values to a Webelement from the steps test class?
I'm trying to have a page object class with just the elements inside it.
but when using a instance from the steps (testclass) I can't use them.
the Xpaths are correct, if I try to call them inside my ...
0
votes
1
answer
408
views
Python_Selenium PageObjects - TypeError: 'tuple' object is not callable
Somebody can give a help...
I am just starting to learn more about PageObjects and Python and I am facing the following problem:
[Card(name ="Dormir", description = "Dormir é muito bom&...
0
votes
2
answers
1k
views
How to identify an element by classname that keeps changing using Selenium
I am trying to locate a buttons element, but every time my test run the element keeps on changing name. The class keeps changing the last digits. For Example, jss2383 to jss4132 as well as all ...
0
votes
0
answers
73
views
Why so many browsers opened after I modified the pytest
I have 3 files:
utlis.py is the base po for page actions
login_page_po.py is the login page po
test_login.py is the test I defined
utlis.py
class DriverUtil:
"""Common utils for ...
0
votes
2
answers
1k
views
Cypress page objects model - use data-test-id or use React test Library cy.findByText to find page object elements?
I am creating a page object for a webpage for a web app that I am testing. I am using Cypress for my automated tests.
I was thinking about using one of two methods for finding page elements. See my ...
0
votes
1
answer
79
views
How to pass dict value into class as argument
I have below page object want to simplify it:
from selenium.webdriver.common.by import By
from support.utlis import DriverUtil
class LoginPage:
def __init__(self):
self.driver = ...
0
votes
1
answer
63
views
Selenium X-path Selectors - I need to be able to select the different options in the drop down menu
I am new to automations.I have a drop down box with many available selections and want add automation but not sure how to add the with the selectors. I was able to get one selection working but want ...
2
votes
0
answers
929
views
Page objects initialization for Playwright
In my current Playwright test automation project, we use page object model pattern.
At the beginning I was initializing all page objects within a test (usually in before hooks)
test('something', async ...