How to open a specific tab in a different page - html

I have a home page on which, inside an IFrame a different HTML page is shown.
On that page there's a link, which on click, needs to open another page inside the same IFrame with specific tab shown. The new page has 3 tabs and the link need to open the second one.
There are other links too, which needs to open specific tabs. The problem is all this is for a demo purpose and no dynamic setting is there. No database or anything. All are static HTML pages.

Tab 2
assuming the page can parse the hash

Related

Is there a way to open a page in an iframe from the previous tab?

I have a website where I host cooking recipes, on the index of the site there is a "recent dishes" button that you can click to view my most recent dish. The problem arises when you factor in that my most recent dish is designed to be viewed inside an Iframe in a "dish index". The dish index has a sidebar with important information that I would like to not have to implement a javascript solution for.
In summary, is there a way to format a link to open the index page, and then open the iframe inside the page?
just for extra clarification, as it seems there are a bunch of questions asking how to do a similar sounding thing.
click link.
link open.
Iframe inside of link opens to a specific page, separate from the default.
Here is a website that has the behavior that I'm looking for, but they're using Framesets and frames which were deprecated in html4 i believe. Please note that the sidebar does not refresh/load when a link is clicked, but the url does.
I've been googling for about 15 minutes now and have not found a solution, other than the javascript one.
From what I understood you want to have a menu and once a link inside this menu has been clicked you want to load different pages. If that is correct then make the menu the main page and then change frame src for different pages. You use target in the link to target the iframe
A short example can be found below
Page 1
Page 2
<iframe src="Page1.html" name="myIframe"></iframe>

What can cause Anchor Links to reload the page?

Recently, I've been working on a WordPress website powered by the Divi theme and builder. Some of the pages have a menu with the URLs set to ID's of certain sections of the page (anchor links) but when clicked, the page refreshes and then scrolls to the relevant section.
What would cause a page to refresh when an anchor link is clicked? I'm baffled!
I've tried changing the URLs (to the below) but still have the same problem.
https://www.domain.co.uk/tables/#breakpoint-one
https://www.domain.co.uk/tables#breakpoint-one
In static HTML, coding something like this would take a matter of minutes so I cannot understand why the page refresh occurs.
Is the refreshing ocurring only the first time you click on an anchored link? or does it happen every time.
Perhaps you have POST data present (like you arrived on the page after submitting a form). I think the behaviour you describe matches that scenario.

i want to show a html page view source but it redirect and show another site view source any one can help me how it done

i want to show a html page view source but it redirect and show another site view source any one can help me how it done
this is the url
https://www.stlouisco.com/rex/now8/MLB-v-Opening-Day-2020-on-tv0s01.html
There are many ways to inspect a page and view its source. A simple one is to right-click on the page and in the context menu, choose "View Page Source".
If right-clicking on the page doesn't work for you for some reason, try this:
In the address bar, add 'view-source' at the start of a webpage that you want to view the source for.
In your case, try this:
view-source:https://mlb.streamsonline.live/
Put it in the address bar at the top of the browser where you would normally put in the URL of the website.

Links not working on Facebook Page Custom Tab

I have created a custom tab for a Facebook page. Everything is displaying, the only issue happening is none of the link in that tab is working. Is there a special code that I need to add for Facebook Tab page in order to make the links work?
This is the facebook tab.
https://www.facebook.com/AstellasUS/app/2475799012460272/
And the links I have used basic HTML below
<li>Twitter: twitter.com/astellasus</li>
<li>LinkedIn: linkedin.com/company/astellas-pharma</li>
<li>YouTube: youtube.com/user/AstellasUS</li>
<li>Website: astellas.us</li>
They are “not working”, because those sites forbid being displayed inside a frame on a different domain, via the X-Frame-Options header.
Trying to open those sites inside the app iframe doesn’t make that much sense to begin with - so simply add target="_blank" to those links, so that they open in a new window/tab.

How to click on a link in an iFrame in selenium IDE

Hello Stackoverflow community,
I am working with selenium IDE and I have the following problem:
I have to move a web content within a web content Management System from one folder to another. Therefore I have to click on a "Select" button to specify a target folder, then an iframe opens up where I can navigate through the "tree structure" of the folders.
The original page looks like this:
original page with "Select"-button
The structure of the web content management system is as follows:
Home
-Test(=Parent Folder):
-UniqueTitle
-UniqueTitle2
Because the folder that I want to adress(UniqueTitle2) lies one hierarchy below my current folder(I am in UniqueTitle), I have to click on the parent Folder "TEST" to go one hierarchy back. This is a link to the "TEST"-folder.
iframe where you can select the target folder
The problem is that on the original page below the iframe, the same Link to the "TEST"-folder exists as a breadcrumb. So if selenium clicks on the href link, it actually clicks the link on the original page, and not the one in the iframe.
I tried the following:
to select the iframe:
storeAttribute|css=iframe.dialog-iframe-node#id|iframeIDE
selectFrame|id=${iframeID}
to click on the link:
clickAndWait|link=TEST
clickAndWait|//a[contains(#href,'https://www.companyname.com/language/projectname/manage/maintenance/web-content-management[...]folderid=465576')]
Here is a HTML Snippet of the iframe:
TEST
How can I differentiate between these two, so my script will click within the iframe?
Thank you in advance and let me know if you need more information.
you have two options:
1. don't use iframe, use div or section instead
using this approach, you have to move the code for file selection to the main page. use AJAX to populate the file list to the div. this approach is often called single page application, though you don't need to move everything to a single page, just the file selection codes.
2. set allow-origin header of your iframe to your domain name or *
you should read about how to set this HTTP header.
here are some refs
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
Probably duplicate of How to switch between frames in Selenium WebDriver using Java
First thing when you want to do something inside iframe is switch to it.
WebDriver.SwitchTo().Frame(WebDriver.FindElement(By.Id("iframe")));
After that you can click on element.
When you want to back you can use:
WebDriver.SwitchTo().DefaultContent();