Open Chrome Command line without 1st run new tabs - browser

I am using a command line script to open a particular web page in Chrome and send keypresses to that web page
When Google Chrome opens for the 1st time chrome opens up its own Tab e.g. welcome to chrome/login to chrome and this throws everything off.
I dont want any new tabs generated I want only the web page I asked for
Is there a command line switch or method to force chrome to not generate its own tabs. Perhaps registry entry etc?
I have tried some but no success so far
Thanks
Confuseis

Since your question contains the AutoIt tag, I have to assume you want an AutoIt solution.
The best way to do this would be to use chromes --new-window command line switch. This opens a new instance of Chrome, with a single tab pointing to the URL provided, by executing the chrome executable via ShellExecute.
$sPath = #HomeDrive & "\Program Files (x86)\Google\Chrome\Application"
ShellExecute($sPath & '\chrome.exe', '--new-window "https://www.google.com/"', $sPath, "", #SW_MINIMIZE)

Related

Using detach to stop Edge Browser from being closed when Selenium program ends

I am using selenium through python to automate a task - open a webpage, enter some text, click a button.
Now, once this is done, I want the browser to stay open and all the python files, the edgedriver.exe cmd window, and any other process ran by the python script to close. I want the browser to be loaded like a normal browser that we load manually.
My query:
Can we stop the browser from closing when I close python program as well as the edgebrowser.exe? I have added this to my code, but this doesn't stop browser from closing once all other windows are closed.
code:
from selenium.webdriver.edge.options import Options
edge_options = Options()
edge_options.add_experimental_option("detach", True)
Using the detach option, I may be able to keep browser running with python closed. But I also do not want the edgebrowser.exe command window on the screen. Can we do that?
Can we remove that line below the address line saying "Your browser is being controlled by an automation test software". I want the browser window to look like it does when we open it using the app/program shortcut.
You can refer to this link to hide the command window. The code only works on selenium version 4.0.0 or higher.
To remove the line "Your browser is being controlled by an automation test software", you can try to add these lines of code:
edge_options.add_argument("--remote-debugging-port=9222")
edge_options.add_experimental_option('useAutomationExtension', False)
edge_options.add_experimental_option("excludeSwitches", ["enable-automation"])

Closing or opening an Excel or Word file in Selenium IDE

Testing a website that has links to various forms. PDF forms work fine as long as I use the “goBackAndWait” command. However if the document is a Word or Excel document, clicking the link opens the document in a new window (not a pop up window). Using the “close” command closes the main window and not the document window.
How to close or open the Excel or word file using Selenium IDE and go back to the page.
Note that the Selenium IDE cannot interact with embedded objects by default.
I can offer you an alternative. Instead of opening the window, I recommend that you just check the URL of the links that you are clicking, and that the href points to the appropriate document extension.
Pseudo:
validatePresent | css=#doclink[href$='.docx']

How to use console.log() to debug a Chrome extension?

I'm trying to debug my Chrome extension using
console.log("message");
My extension works fine (for the most part), I'm clicking buttons that call function which perform something. Every function as a consloe.log() debug line.
If I open the chrome console (ctrl + shift + i) after chrome loads, it remains empty, no matter what I do. Chrome is set to developer mode.
Make sure that you are opening the correct dev console. You need to go to the generated background page for the background page console and right click -> inspect popup for the popup console. There was an answer to a similar question with a nice gif, I will link it if I can find it.

Shortcut for reload jscript file

I am using notepad++ for jscript file editing and TestComplete for automation testing which uses the JScript files, but every time i exit and start the TestComplete whenever i change anything in Jscript file.
is there any short-cut-Key to reload without closing the TestComplete.
So, you are creating a script extension. Thank you for clarification. I have checked the Tools | Customize Keyboard... dialog and there is no a possibility to assign a shortcut to the Reload Script Extensions action. So, you can do this only by manually clicking the Reload button in the Script Extensions dialog. The Alt-F-E shortcut just opens this dialog (File | Install Script Extensions...).
http://www.philnicholas.com/2009/05/11/reloading-your-javascript-without-reloading-your-page/
This page explains what you're looking for, I think. All you need to do is change the event to when ur shortcut key is pressed.

How to open firefox in linux by forcing the firefox not to ask for 'start new session, restore session' dialog?

I am writing automated unit test plugins in java to open a firefox in a linux machine. I don't want the firefox to ask 'Start new session, restore sessions' dialog whenever my code is executing the 'firefox' command to start the firefox program. Is there any command line option in firefox command to tell the firefox program to not display this message? I am trying to google it but not finding any solution for this, Appreciate any help on this.
I don't know a command line argument, but you can adjust this behavior in firefox itself:
type about:config in the URL field
Filter for *browser.sessionstore.resume_from_crash* and set it to false

Resources