selenium - Assert css locator is equal to it's expected value -


I'm doing some drag and drop JS testing with Selenium-Client (it works) Taking the elements clearly before and after Scragrebra), but I am having difficulty in this revolutionary emphasis.

Am I mental, or I can not do anything like this:

selenium.assert_equal ("css locator", "expected ID of element")

Which, in this case, will look something like this:

selenium.assert_equal ("css = li: nth-child (1)", "li # List_item_2 ")

Any suggestion about implementing this would be great.

Thanks

Adam

EDIT: If I had selenium.get_element then he would take a selector and what would happen then I could claim in the next step

i.e.

element = selenium.get_element ("css = li: nth-child (1)") < / P>

(I think).

Your example will not work because you're comparing two strings that are not equal. One way to move your element is to use isElementPreset as the display given below: drag and dropto (selenium.isElementPresent ("css = #source li") : Nth-child (1) ")); Emphasis (selenium.eselment display ("css = # target li: anth-hair (1)")); // drag and drop code here ... // after drag and drop attachments (selenium. I.l.it. display ("css = # target li: anth-hair (1)")); Emphasis (selenium.eselment display ("css = # source li: anth-hair (1)"));

This example uses the Java client API, but it should be easy to do this in how to do it in your favorite client API. This will depend heavily on your application, as the above will be checked that the element with the id of 'target' has a child li before the drag and drop element, and no one else later. If you have a snippet of your HTML source, then I might be able to prove a more robust example.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -