You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey!
So my problem is that i cant use .press_escape or set(Keys.ESCAPE) in some cases.
The code is below:
browser.open("https://www.dns-shop.ru/")
s(by.xpath("//a[text()='ТВ и мультимедиа']")).click()
s(by.xpath("//a[@Class='subcategory__item ui-link ui-link_blue']")).click()
s(by.xpath("//a[@Class='subcategory__item ui-link ui-link_blue']")).click()
ss(by.xpath("//div[@Class='catalog-product__stat']//label[@Class='ui-checkbox']")).element(0).click()
/Problem code below/
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).press_escape()
or
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).set(Keys.ESCAPE)
/Working code/
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).send_keys(Keys.ESCAPE)
or
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).type(Keys.ESCAPE)
The text was updated successfully, but these errors were encountered:
Hey, first of all, please, report an issue appropriately. The good report should contain error message at least and the version of selene you use.
Secondly...
there might be a good reason why set(Keys.ESCAPE) or set_value(Keys.ESCAPE) does not work. set is based on set_value. And set_value is based on clear + send_keys. Some fields have a special behavior for events triggered on clear. That's why you may get not what you expect. Then you just should not use set_value, but use send_keys or type instead.
It's weird though that send_keys(Keys.ESCAPE) works but press_escape() does not, because they should be completely the same under the hood. But to investigate this - I need to see your error message
P.S.
Also, please, since you use selene, learn how to use it more efficientely.
Hey!
So my problem is that i cant use .press_escape or set(Keys.ESCAPE) in some cases.
The code is below:
browser.open("https://www.dns-shop.ru/")
s(by.xpath("//a[text()='ТВ и мультимедиа']")).click()
s(by.xpath("//a[@Class='subcategory__item ui-link ui-link_blue']")).click()
s(by.xpath("//a[@Class='subcategory__item ui-link ui-link_blue']")).click()
ss(by.xpath("//div[@Class='catalog-product__stat']//label[@Class='ui-checkbox']")).element(0).click()
/Problem code below/
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).press_escape()
or
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).set(Keys.ESCAPE)
/Working code/
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).send_keys(Keys.ESCAPE)
or
s(by.xpath("//button[@Class='button-ui button-ui_brand compare-login-modal__login-btn']")).type(Keys.ESCAPE)
The text was updated successfully, but these errors were encountered: