How to open 2nd project in browser when using Webstorm? - webstorm

I'm using Webstorm for my phaser game development. It's been ok up till now but now I'm a tad confused as to how I've got things set up.
I've got a project called say myGame1, and when I run the index page it opens up like this in the browser
http://localhost:63342/myGame1/index.html
And that runs fine.
What I can't seem to figure out is how to set things up so I can have another game project open as well, and open that games index page as well in the browser. Because when I try to do that, it just opens the previous game still.
I think it's got something to do with configurations, I've tried to set up another one but when I try to use that config it just says error 404 when opening in a browser.
Any ideas?

Related

Plugin build with C++/Juce - Crashed validation in LogicProX

I'm completely new to this but I'm taking a course in Audio Plugin Development as a way to try and improve my understanding of C++. I've hit a wall quite early where the plugin caused Logic to crash. I'm using Xcode and Juce and when I got to this point in Xcode and built the plugin, it said 'build succeeded' and opened Logic, which then crashed, directing me back to this line of code
thread 1: breakpoint1.1
If I open Logic independently without Xcode, it's not crashing, but when I reset and rescan plugins, I get a crashed validation for that plugin
Logic: crashed validation
I don't fully understand where it's directing me to or where the problem is, I retraced my steps in following the directions in the course and I think I've done everything correctly. In the previous step I did the initial build of the plugin and that worked fine, without any crashes.
I've tried deleting breakpoints and running again but it's still the same problem. As I say, I'm very new to this so could be something very simple but any help would be great. Thanks a lot

WAMP Server not turning green every time I restart my Surface

I've been using WAMP server for a few of my school projects however I have had a lot of trouble with it staying green. I am pretty sure its an internal issue but I'm not really sure how to figure out what exactly is happening. The main problem I experience is that it installs fine and runs. However, whenever I restart my laptop it will not turn green. It stays orange and says 1 of 2 services running. I tried the methods I saw online however it does not even let me right-click it to see what isn't running or to restart the services. I've had to reinstall it about five times to keep using it and it's getting extremely annoying. I think it has to do with mySQL not starting properly but then why do I not get the option to right click?
check if you have any previous installations ( for example : mysql,MariaDB ..ect ) and open task manager and see the proccess of mysql ( open the properties ) if the path isn't from the wamp mysql then desactivate it / kill the process.
here's FAQ Link that helped me alot in the past , you may find it usefull

Cannot use WebStorm console in 'live' mode

How do I view/peruse objects in WebStorm in console live mode?
In Chrome, when I am sitting on a breakpoint, I can type something into the console like so :
myObject.myVal[0].elem
However when I am in WebStorm, sitting on a breakpoint on one of my tests, I open the console, but I cannot type into the console!! I cannot see any objects.
It just looks like this :
I seem to remember it used to be able to do something like this. Is there some setting somewhere that I need to set?
[..Update..]
Yes, I was right. It was possible for me to do this in the past :
https://blog.jetbrains.com/phpstorm/2014/07/new-live-console-in-javascript-and-node-js-debugger/
This seems not to work for me anymore, or it is broken when running tests.
It makes WebStorm pretty useless for me at the moment.
'Live' mode is not available in Test Frameworks Console; please vote for WEB-20297 to be notified on any progress with this feature

Python Selenium Alert Authentication Trouble

I am trying to access a website that requires a login thru an alert box such as the one below:
I have tried to look up many different ways to do this and they dont seem to work. what i have tried are listed below:
Didnt work and gave me the same login alert.
start_url = 'http://username:password#example.com'
agent.get(start_url)
Keep getting an error message saying "NoAlertPresentException: Message: no alert open"
start_url = 'http://www.example.com'
alert = agent.switch_to_alert()
alert.send_keys("username")
alert.send_keys("password")
Get an error saying webdriver has no attribute "switchTo"
start_url = 'http://www.example.com'
agent.switchTo().alert().sendKeys("username")
I have to use Chrome because of the versions of IE and Firefox I have and can get, do not support the functions in the site
I have been having this exact same issue for some time now - with my end goal being to do this headless (in the background without visually launching an instance of Chromedriver).
Non-Ideal Solution 1:
I first used a library called pynput to automatically type the credentials in to the alert box and click the ok button, it was pretty simple to get working but:
still didn't work headlessly
I had to be focused on the browser or it would type the credentials elsewhere
This worked great in the meantime as everywhere I looked online it seemed like there was nothing I could do to overcome authentication alerts headlessly...
I'm a relative beginner (started programming <1 year ago) so perhaps I just wasn't looking in the right places!
I've now solved this issue though like so:
First I logged in to the alert as normal on Chrome while monitoring the Network section of devtools to get a good look at the GET request for the protected page screencap here:
Upon seeing that the Authorization was Basic (this will work for Bearer too) I tested just copying the same request in Postman with this header and it worked! Now if only there was a way to make http requests from Selenium???
I first tried the library selenium-requests (which didn't work for me: I got the same error as this person https://github.com/cryzed/Selenium-Requests/issues/33
This library seems absolutely excellent and exactly what I needed, I just don't currently have the know-how to get past firewalls/whatever was stopping me at this stage...
What eventually worked for me was the library selenium-wire. I followed this guide https://pypi.org/project/selenium-wire/#intercepting-requests-and-responses to have the webdriver navigate to the protected page as normal, but intercept the request and add the Authorization header before sending it :) now this works for me totally headlessly. Granted, this won't work on more secure websites but I hope it helps someone having the same issue.
This is Pythoncode
Problem with alert boxes (especially sweet-alerts is that they have a
delay and Selenium is pretty much too fast)
An Option that worked for me is: (just exchange the button click in the end with whatever action you want to have)
while True:
try:
driver.find_element_by_xpath('//div[#class="sweet-alert showSweetAlert visible"]')
break
except:
wait = WebDriverWait(driver, 1000)
confirm_button = driver.find_element_by_xpath('//button[#class="confirm"]')
confirm_button.click()
Note to 2: Here is probably the error due to the alert taking more time to load than the single elements (such as username, etc.)
Note to 3.: I think it should be switch_to

Open URL in existing tab in C++ and C

I'm trying to open a URL on my Raspberry PI using C++ or C. Using the command system("xdg-open http://something.com); the default browser opens the first time, but on every next try a new tab opens. I would like to check, if the browser is open, then open the desired url in the existing tab. There is nothing more to it: no posting of any forms, or reading data from the site. How could I achieve this in C++ and C?
Thanks in advance,
Alexander
When using system() you should configure your default browser, so that it opens all external URLs in the current active tab. For instance with Firefox type in the addres bar about:config and search for files begining with browser.link.open_. To answer the question, you should configure the files accordingly:
browser.link.open_external value = 1
browser.link.open_newwindow value = 1
browser.link.open_newwindow.override.external value = 1
browser.link.open_newwindow.restiction value = 0
The above will make sure, that all URLs get open in the same tab, no matter how many times your code repeats itself.
Make sure to open Firefox in advance, otherwise the code will stop running as soon as Firefox opens.