got a scenario going and come to a point where I have to open a link in a new tab, due to if I open it in the current tab with click, when going back to the original page, it goes to the first page of items where I could have been on page 3.
tried using the xclick #right, but it doesn’t seem to click exactly where required and a little to the side, meaning the popup isnt the right one, and doesnt show the open in new tab for me to use xtype function.
is there another way to get the tab to open in a new window
Try to test this if you are using browser automation and replace the link by yours
selectWindow | TAB=OPEN | https://newwebsiteURL.com this opens a new tab and loads the website with the given URL.
The problem with this is that it’s a website with a given URL. what if the URL is unique to the link on the website, as this is, its individual invoices, can you specify an element instead?
click wont work as the name changes continously for each invoice. unless i store that name and reference it over and over as well, but the below might be easier?
I did see there is a store attribute function in uivision, which could solve the problem, but could I get an example of how to use this to extract the href data from the element?
actual code a class=“nav” href=“ViewCreditNote.aspx?creditNoteID=ef3e666a-85ed-4346-9eff-2ad031bdb068” id=“ext-gen43”>Jacobs Bernadine (31813350(C))</a
Looks like there is something wrong in your command, have you tried the @href instead of @id ?
you can run this test to understand more how it works, it’s very simple :
concept seems simple enough, and yet it doesnt work on my side.
I copied your code and pasted and adjusted as required, tried the id and href, and both times it could not find it. what I essentially need is the href link in the image below extracted, and then opened in a new window, while dynamically changing what link to extract, and the only thing that changes i can search for is the persons name after the id ext-genXXX
this is accounting software that requires login etc, an account could be made and the demo company used, but I can’t share anything with you specifically.
This should work fine. Note that XClick | ... | #ctrlclick on the link opens the page in new tab, but does not switch to the new tab! => For this, you need to use selectWindow | tab=1 afterwards. This command switches to the tab on the right of the currently active tab.
Test:
{
"Name": "control click",
"CreationDate": "2021-9-30",
"Commands": [
{
"Command": "open",
"Target": "https://forum.ui.vision/",
"Value": "",
"Description": ""
},
{
"Command": "comment",
"Target": "click // linkText=Categories",
"Value": "",
"Description": ""
},
{
"Command": "XClick",
"Target": "linkText=Categories",
"Value": "#ctrlclick",
"Targets": [
"linkText=Categories",
"xpath=//*[@id=\"ember36\"]/a",
"xpath=//li[3]/a",
"css=#ember36 > a"
],
"Description": ""
},
{
"Command": "selectWindow",
"Target": "TAB=1",
"Value": "",
"Description": "tab=1 is the first tab to the right, COUNTED FROM the currently active tab"
},
{
"Command": "click",
"Target": "linkText=Selenium IDE",
"Value": "",
"Description": ""
}
]
}
the functions works and clicks, but it opens it in the current tab instead of a new tab, tested it manually and it worked as expected, so the command is not registering the ctrl click, just the click
Then you can try with XClickRelative => The anchor image (green box) in this case would be something next to the link that does not change. And the pink box for the click is at the link.
would not work, due to this being the list. and this is just a example, the name in blue is the link, and could change to whatever customer that invoice is for.
same result as before, it navigated to the right spot, but then opened in the current tab. FYI, The demo account in Xero it exactly the same across all users, so if you used that one as a test ground, it would be exactly the same as the one I see.