0

I have an element in my WebPage and this element has no "href" in its HTML code, but the element is clickable and drives to another page, so what I want to do is to open the page in a new window or tab. When I use the key_down(Keys.CONTROL).click(element).key_up(Key.CONTROL).perform()

this just opens the new page in the same window (btw even manually performed, this is same). So even right-click (context menu) doesn't contain the open in new Tab/Window. Is there any possible way to get the URL to where this element drives so that I can open a new window and paste it there, or just open the new page in a new window or tab?

Here is the css code of the Element:

<tr class="ng-scope element-active" ng-if="$data.length" ng-click="$ctrl.open(element)" ng-repeat="element in $data" ng-class="[{ disabled: element.elementStatus == '2' }, 'element-' + element.status.toLowerCase()]">
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
Anas Bouayed
  • 119
  • 1
  • 1
  • 11
  • Can you share the URL if it is a public one? Thanks – undetected Selenium Jul 28 '17 at 12:05
  • So you simply want to open your elment (which I assume has a DOM identifier?) in a new tab? Did you check this https://stackoverflow.com/questions/28431765/open-web-in-new-tab-selenium-python – Mohamed Ali JAMAOUI Jul 28 '17 at 12:06
  • @DebanjanB it's not a public URL but here is how the element looks like in the page `` @MedAli yes I did but this works when you already know the URL you want to access to, which is what I want to get. – Anas Bouayed Jul 28 '17 at 12:54
  • 1
    Please [edit] your question to add any relevant information. And as I suggested in chat, read [ask] and [mcve] to make sure your question is answerable. – Andras Deak -- Слава Україні Jul 28 '17 at 12:55
  • If manually clicking the WebElement opens the new page in the same window, why are you trying to do things differently through Automation? Thanks – undetected Selenium Jul 28 '17 at 12:57
  • Because at some time I need to get back to the previous page where the main test is running and find out that all the already set elements became stale (resetting them takes long time in the test procedure) – Anas Bouayed Jul 28 '17 at 13:01
  • @AnasBouayed As per the `Business Requirement` if the `Production Environment Deployment Code` is configured in such a way that the new page needs to open in the current window/tab, as per Best Testing Practice you must not try to tamper the usual/default behavior of the system. Tampering with the usual/default behavior may result into unexpected system behavior which may make your Test Execution unreliable. Thanks – undetected Selenium Jul 28 '17 at 13:57

0 Answers0