pageobjects

ImportError: No module named base

做~自己de王妃 提交于 2019-12-10 10:23:54
问题 I'm trying to implement PageObject pattern for my first Login test. While running it I'm receiving the following error: >> py.test -v test_login.py ============================= test session starts ============================== platform linux2 -- Python 2.7.3 -- pytest-2.3.4 plugins: xdist collected 0 items / 1 errors ==================================== ERRORS ==================================== ____________________ ERROR collecting test_login_logout.py _____________________ test_login

Can I organize objects in page object model with arrays or hash maps?

笑着哭i 提交于 2019-12-08 11:50:31
问题 I'm new to Selenium automation. And I have fair knowledge in java. I have created test script to use for user registration. I have used page object model for this. This is my page object script. This is What I use public class SIgnUpTest extends PageObject { @FindBy(id="merchantName") private WebElement merchant; @FindBy(id="merchantCode") private WebElement code; @FindBy(id="categoryId") private WebElement category; @FindBy(id="description") private WebElement description; @FindBy(id=

Protractor passes my tests without executing the 'it' blocks

笑着哭i 提交于 2019-12-08 06:54:38
问题 I've recently tried to use the Page Object Model with Protractor following this post http://engineering.wingify.com/posts/angularapp-e2e-testing-with-protractor/ However, when I run my tests, my it blocks do not get executed. Below is my login page object /*File Name : loginPage.js*/ var loginPage = function () { 'use strict'; this.email = element(by.id('Email')); this.next = element(by.id('next')); this.pwd = element(by.id('Passwd')); this.signin = element(by.id('signIn')); this.submitButton

WebDriver PageObjects & Large Amounts of Locators

夙愿已清 提交于 2019-12-07 19:50:03
问题 Over the past year I built a very nice WebDriver framework for my group. Pretty standard fare: Page classes typically encapsulate the full functionality of a page in on our platform (controls as By objects, methods as needed) & extend a base class with some global methods, multiple pages are invoked within JUnit test classes, typical assertion methods, yada yada. Nothing extravagant-very by the books but very functional and flexible. Recently, however, I have been asked to use the framework

NightWatch.js - get a list of child WebElements based on relative css locator

你离开我真会死。 提交于 2019-12-07 11:56:51
问题 Hello all NightWatch adopters, I am trying to parse a table with the following format to get a a list of rows and the cell in each rows <tbody> <tr> // 1 row <td>Item A</td> // name <td>John</td> // owner <td>Monday</td> // create date </tr> <tr> // 2 row <td>Item B</td> <td>Mary</td> <td>Tuesday</td> </tr> </tbody> The code now looks like this which calls the function below. browser.elements('css selector', 'tbody tr', getResultsList); Where my function for parsing now looks like this.

Is JavaScript compatible with strict Page Object Pattern?

♀尐吖头ヾ 提交于 2019-12-07 02:34:54
问题 I have built various Test Automation frameworks using the Page Object Pattern with Java (https://code.google.com/p/selenium/wiki/PageObjects). Two of the big benefits I have found are: 1) You can see what methods are available when you have an instance of a page (e.g. typing homepage. will show me all the actions/methods you can call from the homepage) 2) Because navigation methods (e.g. goToHomepage()) return an instance of the subsequent page (e.g. homepage), you can navigate through your

Protractor Page objects - TypeError: Object #<Object> has no method 'methodName'

我怕爱的太早我们不能终老 提交于 2019-12-06 16:12:52
I'm trying to write a simple test using page objects pattern - based on the ' docs/page-objects '. I created a file describing the page object and other using this page object to test a page. //page object var LoginPage = function() { this.userInput = browser.driver.findElement(by.id('username')); this.pwdInput = browser.driver.findElement(by.id('password')); this.btnEnter = browser.driver.findElement(by.id('btnLogin')); this.get = function(){ browser.get('http://example.com'); }; this.setUser = function (user){ this.userInput.sendKeys(user); }; this.setPasswd = function (password) { this

Selenium PageObjects and PageFactory

只愿长相守 提交于 2019-12-06 14:07:17
PageObject Design Pattern The PageObject design pattern models areas of a UI as objects within test code. The functionality classes (PageObjects) in this design represent a logical relationship between the pages of the application. Each class is referred to as a PageObject and returns other PageObjects to facilitate the flow between pages. Because PageObjects are returned, it becomes necessary to model both successful and unsuccessful events that can occur when interacted with a page. For example, consider logging into Gmail. After entering the user details, the step either passes and

Selenium/PageFactory: Find child elements using parent element's @FindBy?

喜夏-厌秋 提交于 2019-12-06 10:24:08
I'm trying to convert my selenium tests to use the Page Object Model (and, by extension, @FindBy). I have several object definitions like this: public WebElement objectParent() { return driver.findElement(By.name("parent-id")) ; } public WebElement objectChild() { WebElement elem = objectParent(); return elem.findElement(By.name("child-id")) ; } Converting the parent object to using @FindBy is easy: @FindBy(name = "parent-id") WebElement parentObj; Basically, I want to do something like this, if possible (I know this isn't real code, this is just a pseudo example: @FindBy(name = "parent-id")

Running multiple browser instances in the same test spec

◇◆丶佛笑我妖孽 提交于 2019-12-06 10:06:26
If I have a single spec that is using page object model, how do I run multiple browser instance for that same spec? For example I have spec: it('should run multi browser', function() { browser.get('http://example.com/searchPage'); var b2 = browser.forkNewDriverInstance(); b2.get('http://example.com/searchPage'); var b3 = browser.forkNewDriverInstance(); b3.get('http://example.com/searchPage'); SearchPage.searchButton.click(); b2.SearchPage.searchButton.click(); //fails here b3.SearchPage.searchButton.click(); }); How do I reuse vars declared in the SearchPage page object for the other browser