How to automate the Mobile Virtual device testing using Testcafe - javascript

I wrote a simple code(using Javascript) to launch a site and to do some operations.
Using the Testcafe remote command, I am able to get the remote connection URL and QR code.
3.Using(copied) the remote URL, I wrote another Java program to run the remote URL in the virtual device using appium.
Can someone let me know, How can I automate the process to link step2 and step3?

The question is tagged as 'testcafe', but it is more related to automation of processes than to e2e testing with TestCafe.
TestCafe itself only gives you the remote link.
If you want to run your tests on mobile devices, you can check the Browsers in Cloud Testing Services article.
 

Related

With Node Js, Socket.Io bot making

How to run javascript with node js without opening google chrome from different proxies.
Can i get a sample code.
eg project: https://github.com/huytd/agar.io-clone
eg2project: https://drive.google.com/drive/folders/19v9lxRrRqrMp6n3k5rbDRljGVdLYELQc?usp=sharing
I don't want to use the project i link to
briefly: I'm trying to find a code that goes to Facebook.com/nick and clicks the send message button
puppeteer: puppeteer is no-gui-on-gui chromium browser. and nodejs

Automatically test local javascript library on production page

I would like to write an automatic test that goes on a production webpage which is using a specific library and replace it with the version I have on local.
This is useful for me to verify that when a new version of the library will be released to different pages they won't break (kind of smoke test).
For manual test atm I use Requestly to replace the host of the network request to that library, I'm wondering which would be the best test framework/approach to have an automatic test for that.
You can try the following approach:
Upload/Share your rules to get a URL
Create Requestly Rule which you need in production and share it using Requestly Share Rules feature. Once you share the rules, you will get a URL (say X). You can use the url to import the same rules at any other device.
Use Selenium to install Requestly
Use Selenium to open Chrome Browser, Install Requestly from Chrome Store.
Open https://app.requestly.in/rules/ in a tab via Selenium script
Load the Rules
Open url X (Obtained in Step 1) and use selenium script to click on "Import List" button.
Run Automation Tests
Now, you have the rules in your chrome. Use the same selenium session to run your automation tests.
Please note that you have to repeat Steps 1-4 everytime you open a new chrome instance using Selenium (or any other framework). It may increase your automation suite running time a bit but atleast it achieves what you want.

Using a scanner connected to a pc in a web application using php,javascript

How can I use a scanner connected to pc in a web page i'm created using php and javascript
Javascript only interacts with your browser, i don't now if is possible that your scanner act as a WebCam, in this case you can use HTML5 api for webcam
Php or any server-side language is able to interact with the server and run commands , so is posible in someways if your scanner device has some command-line way to scan , but keep in mind this will only work with an scanner attached to the server where this script is host, this probably works for you if you are planning to create this for a home network o company network, mostly like a Web GUI for the "home/company" scanner
if you are thinking to do it to scanning app to the "world", They only way i can think you are able to do it, is probably creating a Java Applet , but nowadays is very common that web browser block java applets
This is not possible directly with JS or PHP, but you can try scanner.js
click here for demo and documentation
Edit:PDF Document for Scanner.js . Just include .js and using javascript callback functions to perform action.

using selenium based python code on azure server

Selemium uses browser to open the page and get content. But on my azure server(command line based) I could not have chrome or firefox. So what is the alternative to use python based selenium code on azure server.
I looked at http://phantomjs.org/ a headless browser. But I guess it is javascript so I would require to convert python code in JS.
Is there any other better alternative?
code snippet:
driver = webdriver.Chrome()
def getVideoTrend(self, item):
driver.get(item['link'])
element = WebDriverWait(driver, 20).until(lambda driver: driver.find_elements_by_class_name('yvp-main'))
self.yahoo_video_trend = []
for s in driver.find_elements_by_class_name('yvp-main'):
print "Processing link - ", item['link']
trend = item
trend['video_link'] = s.find_element_by_tag_name('video').get_attribute('src')
print s.find_element_by_tag_name('video').get_attribute('src')
self.yahoo_video_trend.append(trend)
Try using requests for your browsing needs and BeautifulSoup4 for parsing
So what is the alternative to use python based selenium code on azure
server.
May I know whether you are using Azure Web App? Per my understanding, Azure Web App does not allow us to install the custom software on the server. So in this case you may want to use a virtual machine instead. Windows based virtual machines have GUI pre-enabled, so you only need to use remote desktop to login to the server and install a browser (if you don’t want to use the default IE). For a Linux server, you can install a desktop and then install a browser as well. Please refer to http://blogs.technet.com/b/uktechnet/archive/2013/11/12/running-a-remote-desktop-on-a-windows-azure-linux-vm.aspx to see if this instruction is helpful.

Difficult in debugging Google Drive App

I am build programs by Google Script, and can use its debugger well.
Now, I am building my 1st Google Drive App. The normal operation flow is:
User select files in Google Drive and then call my App => Selected files are passed to my App as State Parameter => doGet() to create/open Client's HTML => User select options in that HTML and submit => Server receive the submitted form and do somethings.
However, debugging Drive App for me is difficult than normal Web Apps and Container-bounded Apps, due to its "State Parameter". I need to publish the Drive App first, and then debug Client's HTML & JScript by Javascript console and Server's GScript by Google Script Editor separately. Is it normal for Web programming? Or have I missed anything? Can I simulate the "State Parameter" for testing, so that I don't need to debug AFTER publish (even using test link) ?
N.B. Since above flow is clear enough, I haven't post demo code here.
You can run an Apps Script in development mode. You can make infinite number of changes to your Apps Script, run it in development mode, and test it without deploying the App. You will see "dev" on end of the URL:
https://script.google.com/macros/s/Aew678900-wdfgyj/dev
When you open up the Publish Your Web App Window, click the:
Test web app for your latest code.
To run it in development mode.

Categories

Resources