Friday, 15 March 2013

Cucumber/Selenium throwing more detailed errors when element not found -



Cucumber/Selenium throwing more detailed errors when element not found -

is there way selenium/cucumber throw more descriptive error when element not found? throws:

the element not found (selenium::webdriver::error::nosuchelementerror)

i'd include locator.

it depends how test fixture code designed , structured. can wrap findelement code within try/catch block. like:

public void testmethod(string elementid) { seek { driver.findelement(by.cssselector(elementid)); } catch(nosuchelementexception exception) { assert.fail("can't find element in page. element is: " +elementid) } }

selenium cucumber runtime-error element

No comments:

Post a Comment