sel.add_script( sel.get_location(), "jquery.js")
idOfResultWithSomeImage=sel.get_eval("window.jQuery('#result').find('img').filter('[alt=SeleImage]').eq(0).parents('form:first').find('a').eq(1).attr('id')")`
pathOfButton="window.jQuery('#" + idOfResultWithSomeImage+ "').parent().find('button')"
isButtonPreset = sel.is_element_present(pathOfButton)
sel.click(pathOfButton)
When I check this in the firebug console, it will find me this button.
I use
and I code in WingIde.
Do you have an idea why?
EDIT
idOfResultWithRyanairFlight=sel.get_eval("window.jQuery('#result').find('img').filter('[alt=Ryanair]').eq(0).parents('form:first').find('a').eq(1).attr('id')")
I check debug mode and:
#it returns true
sel.is_element_present("css=#08f0ddbfa71df43bee87d9becdec5ced4ead3419")
#it returns false
sel.is_element_present("window.jQuery('#08f0ddbfa71df43bee87d9becdec5ced4ead3419')")
#it return false
sel.is_element_present("window.jQuery(#08f0ddbfa71df43bee87d9becdec5ced4ead3419)")
I put these requests in the firebug console and did the first and second work.
EDIT
Interestingly, I wrote the same script in C #, and I have the same problem.
var dOfA = selenium.GetEval("window.jQuery('#result').find('img').filter('[alt=SomeIMG]').eq(0).parents('form:first').find('a').eq(1).attr('id')");
var a=selenium.IsElementPresent("window.jQuery('#" + dOfA + "').parent().find('button')");
var b = selenium.IsElementPresent("$('#" + dOfA + "')");
var c = selenium.IsElementPresent("jQuery('#" + dOfA + "')");
var d = selenium.IsElementPresent("css=#" + dOfA);
var e = selenium.GetEval("window.jQuery('#" + dOfA + "')");
Only d is true.
source
share