There is "Logout" button on this html page and I can't get it to click.

75 views
Skip to first unread message

Janet

unread,
Jul 20, 2016, 2:51:26 PM7/20/16
to Selenium Users


There is "Logout" button on this html page and I can't get it to click.

When I use loginlink, instead of logging out of application, it takes me to the login page....  Since it uses loginlink as well.... driver1.findElement(By.id("loginLink")).click();

HTML:

<a class="ui-first-child ui-last-child ui-btn ui-icon-star ui-btn-icon-left ui-btn-inline ui-mini" id="loginLink" role="button" href="#login" data-transition="pop" data-rel="dialog">Logout</a>

Any suggestions please?

Thank you.

Jegadeesh mani

unread,
Jul 20, 2016, 2:59:47 PM7/20/16
to seleniu...@googlegroups.com

Hi Janet,

Could you please share me entire HTML code?

Thanks
Jegadeesh


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/9bf0f6fc-ac22-4e0f-9211-46da23e7355b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Janet

unread,
Jul 20, 2016, 3:10:33 PM7/20/16
to Selenium Users
Here it is, thank you!

<div class="ui-header ui-bar-inherit" id="mapheader" role="banner" data-role="header">
                <div class="ui-mini ui-btn-left ui-controlgroup ui-controlgroup-horizontal ui-corner-all" data-role="controlgroup" data-type="horizontal"><div class="ui-controlgroup-controls ">
                    <a class="ui-btn ui-btn-inline ui-first-child" id="chatButton" href="#chatpage" data-transition="slide">Chat</a>
                    <a name="postS" class="ui-btn ui-btn-inline" id="postS" data-inline="true" data-mini="true">Sighting</a>
                    <a class="ui-btn ui-btn-inline" id="historyButton" href="#historypage" data-transition="slide">History</a>
                    <a class="ui-btn ui-btn-inline ui-last-child" id="layersButton" href="#layerspanel" data-transition="slide">Layers</a>
                </div></div>
                <div class="ui-mini ui-btn-right ui-controlgroup ui-controlgroup-horizontal ui-corner-all" data-role="controlgroup" data-type="horizontal"><div class="ui-controlgroup-controls ">
                    <a class="ui-first-child ui-last-child ui-btn ui-icon-star ui-btn-icon-left ui-btn-inline ui-mini" id="loginLink" role="button" href="#login" data-transition="pop" data-rel="dialog">Logout</a>
                </div></div>
            </div>

Jegadeesh mani

unread,
Jul 20, 2016, 3:21:41 PM7/20/16
to seleniu...@googlegroups.com

Hi Janet,

Use css locator.

For ex: css=input[id^='Logou']

The above method is use to find the start text in a string.

Please try it about code and let me know.

Thanks
Jegadeesh


Janet

unread,
Jul 21, 2016, 11:51:13 AM7/21/16
to Selenium Users
Hello,

Thank you for your tip.  

I have this line and still did not locate the "Logout".


driver1.findElement(By.cssSelector("input[id=Logout]"));


This is error in Eclipse.

Unable to find element with css selector == input[id=Logout] (WARNING: The server did not provide any stacktrace information)

I wonder what I am doing wrong here.

Thank you in advance.

Janet

Janet

unread,
Jul 21, 2016, 12:54:14 PM7/21/16
to Selenium Users
Hello,

This may be the right html code:

<a class="ui-first-child ui-last-child ui-btn ui-icon-star ui-btn-icon-left ui-btn-inline ui-mini" id="loginLink" role="button" href="#login" data-transition="pop" data-rel="dialog">Logout</a>

Thank you again,

Janet

Janet

unread,
Jul 21, 2016, 4:18:46 PM7/21/16
to Selenium Users
Hello,

I finally got it to work.  Thank you so much!

Do you have any chance worked with like marker on the map which does not have any element associated to it?  We have this case and I need to have it find it and click on it.....

Thank you again,

J

Jegadeesh mani

unread,
Jul 21, 2016, 10:25:54 PM7/21/16
to seleniu...@googlegroups.com

Hi Janet,

As per your css selector code, if you knew the element location then use it otherwise what I mention in the above mail use it.

Thanks
Jegadeesh


Reply all
Reply to author
Forward
0 new messages