automation

Python Selenium Sales Group FB

做~自己de王妃 提交于 2021-02-10 14:33:53
问题 Can i help me , i have a problem trying get div for upload images on sales group in faceboook. I have already a code in python where can write automatic text in the form of the sales group but i dont cant upload image in new version facebook , 1 year ago this is posibility but now facebook dont have a input file Previously the code was as follows **photo_element = driver.find_element(By.XPATH,'//input[@type="file"]') photo_element.send_keys(photo)** But this doesn't work now, I've tried this

How to check downloaded file name?

大城市里の小女人 提交于 2021-02-10 14:21:57
问题 I wrote a test that downloads the export file, but I also need to send this file through email. The problem is that filename is always different and I don't know how to look it up during the test. 回答1: You can retrieve the dynamic downloaded filename from the 'content-disposition' header. import { Selector, RequestLogger } from 'testcafe'; const url = 'https://demos.devexpress.com/ASPxGridViewDemos/Exporting/Exporting.aspx'; const logger = RequestLogger({ url, method: 'post' }, {

How we can access shadow Dom tree elements using karate?

ⅰ亾dé卋堺 提交于 2021-02-10 14:13:15
问题 Using selenium we can access it in this way: def expand_shadow_element(element): shadow_root = driver.execute_script('return arguments[0].shadowRoot', element) return shadow_root outer = expand_shadow_element(driver.find_element_by_css_selector("#test_button")) inner = outer.find_element_by_id("inner_button") inner.click() So in similar way, I tried to find using karate in .js file, write the below code expand_shadow_element(element): shadow_root = driver.execute_script('return arguments[0]

Schedule Python Script in Bash?

时间秒杀一切 提交于 2021-02-10 05:37:54
问题 I am new to scheduling python scripts and need to start a script so it can run for a day or two. I am not allowed to use cron in my environment so am using this bash script. What is a simple test I can do to make sure the python file runs? How would I know that my file ran? And also, if it throws an error, how can I make sure I am notified? Any help would be appreciated. #!/usr/bin/bash while true do DATE="$(date +'%d')" MONTH="$(date +'%m')" YEAR="$(date +'%Y')" HOUR="$(date +'%H')" MINUTE="

AutoIT UIAutomation extension for C#

北战南征 提交于 2021-02-08 12:01:47
问题 Started automating a windows application using Visual Studio with AutoIT.But facing problems with some controls and I came to know about the AutoIt UIAutomation. This is working fine in AutoIt Scite editor but how can we use this in Visual Studio 2015?Thanks in advance. 回答1: Edit: Per the comments of this thread, there is not a way to include other '.au3' files in C#. They'll need to be translated to C# :( I misunderstood the question... this answers how to reference AutoItX in C# Per this

How to send shortcut keys using selenium in python to move through webpage

心不动则不痛 提交于 2021-02-08 11:59:29
问题 I want to move through the all the posts and hitting like on the Facebook, and what I found out is we can move through every post pressing 'j' key on the keyboard and 'l' key to like the post. Now I want to automate this using selenium in Python. how can I accomplish this ? the code I tried is..(only lines which interact with the page) page=driver.find_element_by_tag_name('body') for i in range(10):#i am testing this so i tried to do this for 10 posts time.sleep(2) page.send_keys('j') time

Reading data from excel in selenium C#

浪尽此生 提交于 2021-02-08 11:15:49
问题 I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code: using excel = Microsoft.Office.Interop.Excel; public void TestMethod1() { excel.Application xlApp = new excel.Application(); excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:\Test\TestData.xlsx"); excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];** excel.Range xlRange = xlWorksheet.UsedRange; } I'm getting the following error at the text that is marked in bold in above code:

Reading data from excel in selenium C#

爷,独闯天下 提交于 2021-02-08 11:15:38
问题 I'm trying to read username and password from excel sheet while using Selenium in C# .NET. Below is the code: using excel = Microsoft.Office.Interop.Excel; public void TestMethod1() { excel.Application xlApp = new excel.Application(); excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:\Test\TestData.xlsx"); excel._Worksheet xlWorksheet = **xlWorkbook.Sheets[1];** excel.Range xlRange = xlWorksheet.UsedRange; } I'm getting the following error at the text that is marked in bold in above code:

UI Automation doesn't see hidden windows?

徘徊边缘 提交于 2021-02-08 10:33:34
问题 I have winforms application that is signed and has manifest with level="requireAdministrator" uiAccess="false". I want to start another application with hidden window and to work with it using UI Automation API. Process procinst = new Process(); procinst.StartInfo = new ProcessStartInfo() { WindowStyle = ProcessWindowStyle.Hidden, UseShellExecute = true, ErrorDialog = true, Verb = "runas", FileName = appfilepath }; procinst.Start(); The new process with hidden window can be seen in Spy++ but

How to install the Selenium IDE(selenium-ide-2.9.0.xpi) in Firefox 45.0?

时间秒杀一切 提交于 2021-02-08 10:25:57
问题 Unable to install the Selenium IDE (selenium-ide-2.9.0.xpi), after hitting the allow button, it begins the downloading part and even after completing the downloading the Install button is disabled. [ ] 回答1: I solved this by installing legacy version of Firefox. You have to uninstall the current one then download the old version from https://ftp.mozilla.org/pub/firefox/releases/41.0/win32/en-US/. 回答2: Record and play tests are very hard to maintain. Please consider developing a test automation