Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

For testing the bxslider, you can use some of the following. Every image is in a LI element, so after each click you can test if the next LI has become visible (and the previous one invisible). This will get you the list (try using other locators than XPath when possible).

elements = driver.findElements(By.CssSelector("ul[class=\"bxslider\"] li"));

You might go about it like this: wait until the next image is shown. Either use the ExpectedCondition, see the original post in http://stackoverflow.com/questions/22646031/selenium-wait-until-element-is-not-visiblehttps://stackoverflow.com/questions/22646031/selenium-wait-until-element-is-not-visible or wait until the next image is visible:

wait.Until(drv => elements[1].Displayed);

And then check if the previous one is no longer displayed.

Alternatively, if you are aware of the sourcefiles' names, you can use those. As you know the number of elements (.Count property) you can easily test if the first image returns after you skip the last one.

For testing the bxslider, you can use some of the following. Every image is in a LI element, so after each click you can test if the next LI has become visible (and the previous one invisible). This will get you the list (try using other locators than XPath when possible).

elements = driver.findElements(By.CssSelector("ul[class=\"bxslider\"] li"));

You might go about it like this: wait until the next image is shown. Either use the ExpectedCondition, see the original post in http://stackoverflow.com/questions/22646031/selenium-wait-until-element-is-not-visible or wait until the next image is visible:

wait.Until(drv => elements[1].Displayed);

And then check if the previous one is no longer displayed.

Alternatively, if you are aware of the sourcefiles' names, you can use those. As you know the number of elements (.Count property) you can easily test if the first image returns after you skip the last one.

For testing the bxslider, you can use some of the following. Every image is in a LI element, so after each click you can test if the next LI has become visible (and the previous one invisible). This will get you the list (try using other locators than XPath when possible).

elements = driver.findElements(By.CssSelector("ul[class=\"bxslider\"] li"));

You might go about it like this: wait until the next image is shown. Either use the ExpectedCondition, see the original post in https://stackoverflow.com/questions/22646031/selenium-wait-until-element-is-not-visible or wait until the next image is visible:

wait.Until(drv => elements[1].Displayed);

And then check if the previous one is no longer displayed.

Alternatively, if you are aware of the sourcefiles' names, you can use those. As you know the number of elements (.Count property) you can easily test if the first image returns after you skip the last one.

Source Link
FDM
  • 5.9k
  • 1
  • 17
  • 34

For testing the bxslider, you can use some of the following. Every image is in a LI element, so after each click you can test if the next LI has become visible (and the previous one invisible). This will get you the list (try using other locators than XPath when possible).

elements = driver.findElements(By.CssSelector("ul[class=\"bxslider\"] li"));

You might go about it like this: wait until the next image is shown. Either use the ExpectedCondition, see the original post in http://stackoverflow.com/questions/22646031/selenium-wait-until-element-is-not-visible or wait until the next image is visible:

wait.Until(drv => elements[1].Displayed);

And then check if the previous one is no longer displayed.

Alternatively, if you are aware of the sourcefiles' names, you can use those. As you know the number of elements (.Count property) you can easily test if the first image returns after you skip the last one.