Reputation: 323
I am trying to create page object elements inside a function so that i could change the element property depending upon the parameter.
class SomePage
include PageObject
def create_element(x)
div(:my_element, :id => "something-{x}")
end
end
But when i call this function i am getting below error:
undefined method `div' for #<SomePage:0x35a6be8> (NoMethodError).
If i write the same code with a fixed property value, it works fine. But i need to create elements in the above way using a function.
Upvotes: 0
Views: 116