Selenium Framework Refinement Needed

  • 状态: Pending
  • 奖金: $30
  • 参赛作品已收到: 0

竞赛简介

Hi,

I have a framework build. I am using Cucumber and Page Object model.
In every cucumber step-def I have to create object of page class.

I want to have one global object and call it in the step-def.



I want to declare the page class object once. I tried doing it and getting null pointer error.

Need Help.

您还可能感兴趣的技能

公共说明面板

  • TraciY
    TraciY
    • 4 年 之前

    I don't see your project extended and I cannot submit any entry anymore. I hope the following can help you continue. It's a general concept how you do this.

    • 4 年 之前
  • TraciY
    TraciY
    • 4 年 之前

    public class BasePage {
    protected WebDriver driver;

    public BasePage(WebDriver driver){
    this.driver = driver;
    PageFactory.initElements(driver, this);
    }
    }

    • 4 年 之前
  • TraciY
    TraciY
    • 4 年 之前

    In your step-def file, declare the page variable. Have a constructor in each of your page class and extend this class to have a BasePage class.

    • 4 年 之前
  • TraciY
    TraciY
    • 4 年 之前

    I am ready to take a look at your code if you are interested in extending your project.

    • 4 年 之前
  • TraciY
    TraciY
    • 4 年 之前

    I am sorry for the late reply. I am currently working on a project but just think that I may be able to get something out on top of my head. It would be nice if you can post your codes so I can take a look on my breaks.

    • 4 年 之前
  • TraciY
    TraciY
    • 4 年 之前

    How do you declare your page objects? Is it possible to take a look at your code?

    • 4 年 之前
    1. alamsyed1207
      竞赛主办者
      • 4 年 之前

      Yes do you wanna connect now?

      • 4 年 之前

显示更多评论

如何以竞赛开始

  • 发布您的竞赛

    发起您的竞赛 快速简单

  • 获取众多参赛作品

    获取大量参赛作品 来自世界各地

  • 悬赏最佳参赛作品

    悬赏最佳参赛作品 下载文件-简单!

立即发布竞赛 或者立即加入我们!