pageobjects

How to identify a particular Page Object fragment member element through Selenium

淺唱寂寞╮ 提交于 2021-02-10 12:53:01
问题 In our project we have multiple selenium tests run with cucumber which are testing specific components. One of these components are two identifiers, which we call country identifier and site identifier. These have the following HTML: <div class="identifiers"> <div class="country-identifier"> <span class="ident-label"> Germany </span> </div> <div class="site-identifier"> <span class="ident-label"> Gaming </span> </div> </div> Now our tests have two models, one for each identifier: @PageObject

Should Page Objects Return Page Objects?

半城伤御伤魂 提交于 2021-02-07 08:15:51
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

Should Page Objects Return Page Objects?

二次信任 提交于 2021-02-07 08:05:30
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

Should Page Objects Return Page Objects?

爱⌒轻易说出口 提交于 2021-02-07 08:03:02
问题 We're currently working on building up a good test frame in our company. It's for a medium-to-large-sized webapp, perhaps with a couple dozen pages. We're currently writing mostly WebDriver Selenium UI-based tests. We are trying to decide on some coding standards, and one thing we're discussing is whether to use Page Objects (PO) that always return PO (even if the page is the same), only return PO when you leave the current page for a new one, or even to not return PO. I've always thought

Selenium Java - Page Object Model Query

江枫思渺然 提交于 2020-07-22 21:40:53
问题 Imagine there is a page say http://google.com/AddUser and here you enter details for a record and click save. Once you do this the page redirects to http://google.com/userList where you can see list of users including the new record you just entered. If we are going by page object model, the method to enter details and save record should exist on AddUser.java and the method to validate if the record was actually saved and displayed should be on UserList.java If we consider addUser and

How to explicitly wait while using page factory in Selenium?

橙三吉。 提交于 2020-07-20 17:06:58
问题 I'm going to organize an explicit wait in Selenium like this: WebDriverWait = new WebDriverWait(driver,30); WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(locator)); The problem is that I don't have the driver in my class, because I used the PageFactory, not a constructor in a test class: MyClass myform = PageFactory.InitElements(driver, MyClass.class) What is a good decision to organize explicit wait in this case? 回答1: I would suggest that you use the PageFactory

Is there any alternative for PageFactory using net core

淺唱寂寞╮ 提交于 2020-06-16 04:17:29
问题 I'm using Selenium v3.6.0 and .NET Core 2.0, the following code gives me an error on PageFactory.InitElements saying it doesn't exist in the currenct context. using OpenQA.Selenium; using OpenQA.Selenium.Support.PageObjects; namespace Example { public class Form { [FindsBy(How = How.Name, Using = "Filter")] // This does exist in current context using .NET Core public IWebElement Filter { get; set; } [FindsBy(How = How.TagName, Using = "Button")] public IWebElement Button; public Form

Is there any alternative for PageFactory using net core

微笑、不失礼 提交于 2020-06-16 04:17:27
问题 I'm using Selenium v3.6.0 and .NET Core 2.0, the following code gives me an error on PageFactory.InitElements saying it doesn't exist in the currenct context. using OpenQA.Selenium; using OpenQA.Selenium.Support.PageObjects; namespace Example { public class Form { [FindsBy(How = How.Name, Using = "Filter")] // This does exist in current context using .NET Core public IWebElement Filter { get; set; } [FindsBy(How = How.TagName, Using = "Button")] public IWebElement Button; public Form

How to check if the button is clickable using selenium webdriver

不打扰是莪最后的温柔 提交于 2020-01-17 07:08:33
问题 I am trying to find if the button element is clickable which I am not able to validate successfully using selenium webdriver. Here is my code to validate if the element is clickable boolean installAFile; String classValues = driver.findElement(by.XPATH("//button[contains(., 'Install a new file')]")).getAttribute("class"); installAFIle = classValues.contains("iconbutton-button--clickable"); return installAFIle; Here is the HTML <div> <!-- react-text: 406 --> test message 1 <!-- /react-text -->