I have a graph displaying different prices of different products. I need to click on each of the data points. However, some of the data points overlap when 2 products have the same price. Thus, I would get an error that another element would receive the click. How should I handle this?
I’ve run into this before, I use the javascript click method as well. I’ve stored it as a keyword and call the keyword to click the object. However I did notice that you dont’ have the web element piece. Could this be what is missing?
public class JavascriptClick {
@Keyword
def clickUsingJS(TestObject to) {
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(to, 30)
JavascriptExecutor executor = ((driver) as JavascriptExecutor)
Hi B L,
Thanks for your reply. I’ve already tried creating a custom keyword but it didn’t work 'cause it gave me an error that “click() is not a function”. So, I’ve insert the JS itself into my script. It says that the click was successful but the data point was not actually clicked.