Open danielrzad opened 3 months ago
The function of page.close() is to close the current tab, not the browser, unless there is only one tab in the browser.
The function of page.close() is to close the current tab, not the browser, unless there is only one tab in the browser.
I know that. I just want to close the first (initial) tab and continue using second one as a main tab.
Hi guys,
I'm trying to switch from Selenium to DrissionPage, and I'm stuck on two things:
1) I don't know how to properly assign a new tab to the page after closing the initial tab. It's not a big issue, but the problem is probably due to my incompetence :smiley:. Below is a code example to better explain what I'm trying to do:
2) In my Selenium project, I used Expected Conditions quite a lot. I mainly found the condition named EC.invisibility_of_element_located useful, which I used to check if a given element is not visible in the DOM. I know that DrissionPage has
wait.ele_hidden()
andwait.ele_deleted()
, but the difference is that those methods will raise an error if they don't find the element at their startup. In Selenium, code like:returned True even if the specified element was never present in the DOM. I want to achieve something similar with DrissionPage. Maybe someone knows what approach I should use for this?
Best regards, Dan.