Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
l3l00
Active particpant
Active particpant
Posts : 11
Join date : 2015-01-06

Page Objects and testcases in Test cases Problem cSharp Empty Page Objects and testcases in Test cases Problem cSharp

Tue Jan 06, 2015 2:23 am
So, I have setup a class that contains the setup & teardown attributes called Gears.
I have a class that holds the pageObjects and Gears is extended on it and a class for the testcases - Gears also extended on it as well.

So I will have a test case like:

Test
public void test_pageObjectISSue() {
payments_targetPoints pageObject = new payments_targetPoints();

driver.Navigate().GoToUrl("someURL");
driver.Navigate().GoToUrl("someURL");

pageObject.testEcho();
}

Another:

Test
public void test_shouldwork() {
payments_targetPoints pageObject = new payments_targetPoints();


test_pageObjectISSue();

pageObject.testEcho();

}


public void testEcho()
{
Utilities genUtilz = new Utilities();

this.driver = driver;
try
{
Console.Write("\n" + "This is just a simple test");
driver.Navigate().GoToUrl("someURL");
genUtilz.WaitForTesto("tag", "body", 10, driver);

}
catch {
Console.Write("\n" + "could not print");
driver.Quit();

}

}



The second test case calls the first one, what I have been noticing on my other test cases, I would get the pageObject I would call to fail? This one I get an Object Reference no initiated, however on others, it will run through just fine but the pageObject try & catch will catch everytime. I do not know what I am doing wrong?
Back to top
Permissions in this forum:
You cannot reply to topics in this forum