Tag Info

Hot answers tagged

5

My first advice is to not write automated tests for pages that change frequently. You may be better off testing those pages manually. If you insist on automation, think about which aspects of the pages do not change, and write classes to model those aspects. For example, if forms always consist of text fields and a submit button, you can write a class to ...


3

PageObjects The code of automated test cases should be easy to understand and not too complex. If a test fails, we want to know why and this as soon as possible. To allow this exists PageObjects. PageObjects are classes that contains WebElements and every actions associated with those. A PageObject looks like this: class HomePage { WebDriver driver; ...


1

Sometimes it so happens that the wait commands do not work. Instead of the wait command of selenium try using Thread.sleep(); command of java. This command will pause execution of the script for the given time...


1

There are three main advantages to putting your functions into PageObjects rather than just having a bunch of static functions: Context. LoginPage.clickNext() vs ItemDetails.clickNext() immediately tells you what page you're on when looking at the test, even if they're identical methods inherited from a parent class. The PageObjectFactory can ...


1

Though there are many advantages of Page Project Model, some of them are : Simple and clear page classes with sensible method names. You can actually give the customize names to you methods. Like above so that you need not to keep anything in mind. Just looking into the method name gives you all idea about the capabilities of the method. Makes tests more ...


1

There are two parts to this. The first is that you need to be sure that your xPath is correct. One way to validate that is to use a tool like Firefinder (a firefox extension for firebug). Navigate to your page and be sure the element you need is present and then hit f12 and go to the FireFinder section. Enter in the xpath you are using and see if it can ...


1

Can you find it if you use the .Text and then clicking it if it matches? String Expectedtext = "Procurement" String ProcurementButtonText = driver.FindElement(By.XPath("//td")).Text; if (ProcurementButtonText == Expectedtext) { driver.FindElement(By.XPath("//td")).click() }



Only top voted, non community-wiki answers of a minimum length are eligible