want to click on the particular link in selenium - selenium-webdriver

suppose if you click on the contact us page ,in that page you want to click on the india in the list of the countries present in the contact us page.How we can write code for this in selenium

driver.findElement(By.id("contact us")).click();
driver.findElement(By.id("India")).click();
Here instead of Id use can use Xpath,Text,CSS also

Related

How do i add a related record to a lightning page layout

I'm trying to add a related record to a lightning page layout for BAN but don't have an update/new action to associate with it
My goal is based on the BAN entered into the Case to show the BAN page on the Case lightning page for a custom object
Carolyn
We don't know what BAN is (some custom object specific only to your Salesforce org?) and how they're related to each other ;)
You have a lookup field on Case that points to BAN and you want to show more details than just the name/link? Check if what I did in https://stackoverflow.com/a/61280895/313628 is any help. You edit the Lightning Page, find "record detail" component, drop it somewhere, configure a bit, job done?

Setting Up Dynamic Redirects upon User registration/login - Joomla

I'm not sure if this is possible at all but this is what I want to acheive:
The website I am working on for a martial arts school.I have program pages that give general info on them. Then I have a link that says 'register to view available times' (for a free trial).
I am wondering how to get the user to the specific page for that program's registration. After that, I want to apply the same sort of thing to each program page. E.g. If I am on kids classes > Register > Redirect to Kids Class Times
Womens > Register > Redirect to Women's Class Times.
Also, want the same thing to happen for a 'login' function.
Joomla natively does not support this. You will have to use a third party extension to achieve this. I have used Community Builder (https://www.joomlapolis.com/) before that is both free and open-source that can do what you want.
If i understood your question you like to put some content in to view only for person who is registered on your website.
Here is how to.
1. Create menu item in menu manager >
Add content to your menu. ( modules , articles ) > .
Set the same menu item from Public to Registered.
Button to do so, will be on right side tab: " Details " in menu setting.
2.Then you create a link to these menu or item alias which is public. When the person will click on link the joomla will ask for login and redirect to the menu page.
Hope this helps.

Testing with Robot framework - Click navbar link in homepage after logging in failing

I am testing a web application using the Robot framework and the Selenium2Library. I have tested successfully the login scenario, and now am trying to click on a link n the navbar in the homepage after logging in. The relevant part of my text file is given below:
*** Keywords ***
Go to login page
Open Browser ${HOMEPAGE} ${BROWSER}
Login with invalid credentials should fail
[Arguments] ${username} ${password}
Input Text id=userName ${username}
Input Text id=passWord ${password}
Click Button Login
Page Should Contain Password
Test Login
[Arguments] ${username} ${password}
Input Text id=userName ${username}
Input Text id=passWord ${password}
Click Button Login
Page Should Contain dashboard.php
Add Catalog
Click Element link=Catalog
Page Should Contain Add catalog
Unfortunately, when the Add Catalog test is run, I keep getting the error -
Test adding items to catalog | FAIL |
ValueError: Element locator 'link=Catalog' did not match any elements.
I can't see the dashboard.php page opening after the previous tests complete successfully. The Catalog link is present on that page. Should I modify the Add Catalog keyword so that it somehow loads the dashboard.php page, or is my syntax for clicking on Catalog wrong? Please help!!
As per code provided, once 'Test Login' keyword execute successfully then dashboard.php will display. In this page you are trying to click on link=Catalog.
As per provided question, you did not specified as dashboard.php is displayed or not after login or as is it taking some time to display that page?
If it is taking some time to display dashboard.php after login, then you need wait for some time. you may try below one at top which wait up to 15 sec
Library | Selenium2Library | 15
Or else you can use below one before click on link in Add Catalog keyword
http://robotframework.org/Selenium2Library/doc/Selenium2Library.html#Wait%20Until%20Element%20Is%20Visible
if dashborad.php page displayed but still getting link error then try with another locator.
If dashboard.php page is not displaying after executing the 'Test Login' check that keyword again. Click on login button may not simulated correctly.
Thanks
If the web app takes time to load, you need to insert wait conditions on your actions before you verify them.
Add Catalog
Click Element link=Catalog
Wait Until Element Is Visible ${SOME_ELEMENT_THAT_LOADS_LAST}
Page Should Contain Add catalog
Hope that helps

In Drupal 7 views how to give external link (another website) to a title?

Iam new to drupal 7 views.
I have a content type contains title, description fields. I want the content title's to scroll at the top of the page, so that i created a view and it works fine.What is my question is, i want to link a content (eg: 1st content (title) in a scroll) to another website instead of content page, the remaining contents linked to the content page. Is it possible?.If it is possible how it can be done?..
Thanks in advance,
A.John Melchior.
Yes, it's possible.
One way to do it, would be to use the Link module to create a link field in your node.
Use the link field to input the external link value.
In views add the link field, before the title ( order is important ) and exclude it from display
Add the node title field in the views and in the rewrite field output option, use one the link field token as your path.
I'm not looking at the Views UI right now , but you should find at least a couple of ways to redirect content when the node title is clicked. You should have the Rewrite field output and the Output this field as a link.
You could make use of Display Suite coupled with the description above.
Create a link field for your nodes.
Create 2 view modes for your content type via Display Suite. View Mode 1 will show the link field as the first data element, View Mode 2 will show the title as the first element.
Configure your view to show output using Display Suite, configured to show the first record using View Mode 1, all others using View Mode 2.

Passing record id via Link to Visualforce detail page

<apex:outputLink value="/!{opportunity.id}">{!opportunity.Name}</apex:outputLink>
I am creating 2 pages in VF. One page to display a list of custom object records from a dynamic search. This is complete.
I need to now create a custom VF page to display a single record information when a user clicks on a link on the list page. I know we can use an output link like the one shown above.
Assuming I have built the detail page (assume its path is "apex/customDetailPage"), how would I go about modifying this link. Because my detail page will need the selected record id passed to it I suppose.
You can do it just like this:
<apex:outputLink value="/apex/customDetailPage?id={!opportunity.id}">
{!opportunity.Name}
</apex:outputLink>
Assuming that your custom page checks for the id parameter to establish which record it should be working with.
You can also use the $Page global variable option as described here which should mean it'll look something like this:
<apex:outputLink value="{!$Page.customDetailPage}?id={!opportunity.id}">
{!opportunity.Name}
</apex:outputLink>

Resources