When writing end to end selenium tests, should I navigate to a page or just open the URL? - selenium

Say I need to submit a form on the 'Classes' page. I am testing the 'enroll into class' feature. Do I navigate to the page by clicking on the menu bar, or do I just directly open the URL of the page?

It depends on the scenario you need to test.
As an autoimation engineer you need to work according to the documentation.
If no scenario defined you can choose easiest way to do that.

Incase clicking on the menu bar is the part of your #Test, you have to access the base page and navigate to the desired page by invoking click() on the menu bar.
Else you can directly open the URL of the page.

Related

Click on web browser

I want to programatically click on WebBrowser1's web page.
I tried: WebBrowser1.Document.Click(), it doesn't work.
You cannot click the document itself, however you can access the body via WebBrowser.Document.Body and then call InvokeMember() on that:
WebBrowser1.Document.Body.InvokeMember("click")

Is there a way to programmatically click links, input info into login forms, etc in Objective-C? (like Mechanize does)

Is there anything similar to Mechanize for Objective-C? I want to enter info into a search bar, select a link, and then extract some information from the webpage
You can either run JavaScript code in the context of your WebView or interact with its DOM yourself.
You can inject javascript into the page to do what you want with stringByEvaluatingJavaScriptFromString. For example to simulate a click, inject:
getElementById('the_button').click();

How to customize my own Facebook Login button?

When the user loads the page in their browser, the JavaScript SDK renders the Login Button on your page
What if I don't want to use their button?
How to customize my own Facebook Login button?
You should be able to override the CSS. Try using Firebug or the equivalent tool ("Inspect Element") in other browsers to see how it's done. The button is on your site, thus your CSS is taken into consideration. If you make it more specific than the CSS from Facebook, your CSS will take precedence. For example: include the class name or id of an outer element.

using selenium-rc can i load a page, click a bookmarklet, and fill up the in-page loaded form?

Is there anyway by which I can automate the following steps
in Selenium-rc
open a page
click on bookmarklet in browser toolbar
fill up data in the form loaded into the page by said bookmarklet.
If the bookmarklet is not accessible as it is part of the browser/bookmark toolbar,
is there a way in which I can inject the javascript into the page and have it execute?
You are 99% there! You're right, you can't actually click the bookmarklet, but you can inject the same JavaScript in to the page. Simply use the getEval() command to evaluate the JavaScript.

Selenium Address Bar

Good morning
I am using selenium and I have come up against a bit of a wall.
I am attempting to navigate to another page, by typing in the address bar, however I cant seem to do this when using selenium.
Is this possible?
I am not able to simply put a link on the page that goes to this page.
Cheers Cameron
Short answer: Try the "open" command.
Long answer: Selenium doesn't support "typing in the address bar". It can only control what is IN the page canvas, or more specifically, it can only do what JavaScript can do. In other words, it can change the location, but not by actually typing something in to the address bar. The open command uses JavaScript to change the page's location.
The address bar is where you put the base url,
and to use the open the url you need to use the selenium open command,
EX:
Base URL: google.com
command1#
command = open
target = /