Selenium Framework Refinement Needed

  • Status: Pending
  • Hadiah: $30
  • Penyertaan diterima: 0

Ringkasan Peraduan

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.

Kemahiran Disyorkan

Papan Penjelasan Umum

  • TraciY
    TraciY
    • 2 minggu yang lalu

    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.

    • 2 minggu yang lalu
  • TraciY
    TraciY
    • 2 minggu yang lalu

    public class BasePage {
    protected WebDriver driver;

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

    • 2 minggu yang lalu
  • TraciY
    TraciY
    • 2 minggu yang lalu

    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.

    • 2 minggu yang lalu
  • TraciY
    TraciY
    • 2 minggu yang lalu

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

    • 2 minggu yang lalu
  • TraciY
    TraciY
    • 2 minggu yang lalu

    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.

    • 2 minggu yang lalu
  • TraciY
    TraciY
    • 2 minggu yang lalu

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

    • 2 minggu yang lalu
    1. alamsyed1207
      Penganjur Peraduan
      • 2 minggu yang lalu

      Yes do you wanna connect now?

      • 2 minggu yang lalu

Tunjukkan lebih banyak komen

Bagaimana mula dengan peraduan

  • Paparkan peraduan anda

    Paparkan Peraduan Anda Cepat dan mudah

  • Dapatkan berjuta penyertaan

    Dapatkan Bertan-tan Penyertaan Dari serata dunia

  • Anugerahkan penyertaan terbaik

    Anugerahkan penyertaan terbaik Muat turun fail-fail - Mudah!

Paparkan Peraduan Sekarang atau Sertai kami Hari Ini!